1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package com.sun.star.lib.uno.typeinfo; 24 25 import com.sun.star.uno.Type; 26 27 public class MemberTypeInfo extends TypeInfo 28 { 29 int m_index; 30 private final Type m_unoType; // @since UDK 3.2 31 private final int m_typeParameterIndex; // @since UDK 3.2 32 33 /** 34 Create a member type info with a UNO type that cannot unambiguously be 35 represented as a Java 1.2 type. 36 37 @param name the name of this member; must not be <code>null</code> 38 39 @param index the index among the direct members 40 41 @param flags any flags (<code>UNSIGNED</code>, <code>ANY</code>, 42 <code>INTERFACE</code>, <code>TYPE_PARAMETER</code>) 43 44 @param unoType the exact UNO type; or <code>null</code> if the UNO type 45 is already unambiguously represented by the Java 1.2 type 46 47 @param typeParameterIndex the index of the type parameter that determines 48 the type of this parameterized member; or <code>-1</code> if this member 49 is of an explicit type, or is the member of a plain struct type 50 51 @since UDK 3.2 52 */ MemberTypeInfo( String name, int index, int flags, Type unoType, int typeParameterIndex)53 public MemberTypeInfo( 54 String name, int index, int flags, Type unoType, int typeParameterIndex) 55 { 56 super(name, flags); 57 m_index = index; 58 m_unoType = unoType; 59 m_typeParameterIndex = typeParameterIndex; 60 } 61 MemberTypeInfo(String name, int index, int flags )62 public MemberTypeInfo(String name, int index, int flags ) 63 { 64 this(name, index, flags, null, -1); 65 } 66 getIndex()67 public int getIndex() 68 { 69 return m_index; 70 } 71 72 /** 73 Get the exact UNO type of this member type info, in case it cannot 74 unambiguously be represented as a Java 1.2 type. 75 76 @return the exact UNO type of this member type info, or <code>null</code> 77 if the UNO type is already unambiguously represented by the Java 1.2 78 type 79 80 @since UDK 3.2 81 */ getUnoType()82 public final Type getUnoType() { 83 return m_unoType; 84 } 85 86 /** 87 Returns the index of the type parameter that determines the parameterized 88 type of this member. 89 90 @return the index of the type parameter that determines the type of this 91 parameterized member; if this member is of an explicit type, or is the 92 member of a plain struct type, <code>-1</code> is returned 93 94 @since UDK 3.2 95 */ getTypeParameterIndex()96 public final int getTypeParameterIndex() { 97 return m_typeParameterIndex; 98 } 99 } 100 101 102