Class TypeCodeImpl

java.lang.Object
org.omg.CORBA.TypeCode
com.sun.corba.ee.impl.corba.TypeCodeImpl
All Implemented Interfaces:
Serializable, IDLEntity

public final class TypeCodeImpl extends TypeCode
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • tk_indirect

      private static final int tk_indirect
      See Also:
    • EMPTY

      private static final int EMPTY
      See Also:
    • SIMPLE

      private static final int SIMPLE
      See Also:
    • COMPLEX

      private static final int COMPLEX
      See Also:
    • typeTable

      private static final int[] typeTable
    • kindNames

      static final String[] kindNames
    • _kind

      private int _kind
    • _id

      private String _id
    • _name

      private String _name
    • _memberCount

      private int _memberCount
    • _memberNames

      private String[] _memberNames
    • _memberTypes

      private TypeCodeImpl[] _memberTypes
    • _unionLabels

      private AnyImpl[] _unionLabels
    • _discriminator

      private TypeCodeImpl _discriminator
    • _defaultIndex

      private int _defaultIndex
    • _length

      private int _length
    • _contentType

      private TypeCodeImpl _contentType
    • _digits

      private short _digits
    • _scale

      private short _scale
    • _type_modifier

      private short _type_modifier
    • _concrete_base

      private TypeCodeImpl _concrete_base
    • _memberAccess

      private short[] _memberAccess
    • _parent

      private TypeCodeImpl _parent
    • _parentOffset

      private int _parentOffset
    • _indirectType

      private TypeCodeImpl _indirectType
    • outBuffer

      private byte[] outBuffer
    • cachingEnabled

      private boolean cachingEnabled
    • _orb

      @Copy(IDENTITY) private transient ORB _orb
    • wrapper

      @Copy(IDENTITY) private static final ORBUtilSystemException wrapper
  • Constructor Details

    • TypeCodeImpl

      public TypeCodeImpl(ORB orb)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, TypeCode tc)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name, StructMember[] members)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name, TypeCode discriminator_type, UnionMember[] members)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name, String[] members)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name, TypeCode original_type)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, String id, String name)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, int bound)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, int bound, TypeCode element_type)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, int bound, int offset)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, String id)
    • TypeCodeImpl

      public TypeCodeImpl(ORB orb, int creationKind, short digits, short scale)
  • Method Details

    • readObject

      private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException
    • createFromNonNativeTypeCode

      private void createFromNonNativeTypeCode(ORB orb, TypeCode tc)
    • createPrimitiveTypeCode

      private void createPrimitiveTypeCode(ORB orb, int creationKind)
    • createStructTypeCode

      private void createStructTypeCode(ORB orb, int creationKind, String id, String name, StructMember[] members)
    • createUnionTypeCode

      private void createUnionTypeCode(ORB orb, int creationKind, String id, String name, TypeCode discriminator_type, UnionMember[] members)
    • createValueTypeCode

      private void createValueTypeCode(ORB orb, int creationKind, String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)
    • createEnumTypeCode

      private void createEnumTypeCode(ORB orb, int creationKind, String id, String name, String[] members)
    • createAliasTypeCode

      private void createAliasTypeCode(ORB orb, int creationKind, String id, String name, TypeCode original_type)
    • createObjrefTypeCode

      private void createObjrefTypeCode(ORB orb, int creationKind, String id, String name)
    • createStringTypeCode

      private void createStringTypeCode(ORB orb, int creationKind, int bound)
    • createArrayTypeCode

      private void createArrayTypeCode(ORB orb, int creationKind, int bound, TypeCode element_type)
    • createRecursiveSequenceTypeCode

      private void createRecursiveSequenceTypeCode(ORB orb, int creationKind, int bound, int offset)
    • createRecursiveTypeCode

      private void createRecursiveTypeCode(ORB orb, String id)
    • createFixedTypeCode

      private void createFixedTypeCode(ORB orb, int creationKind, short digits, short scale)
    • convertToNative

      protected static TypeCodeImpl convertToNative(ORB orb, TypeCode tc)
    • newOutputStream

      public static CDROutputObject newOutputStream(ORB orb)
    • indirectType

      private TypeCodeImpl indirectType()
    • tryIndirectType

      private TypeCodeImpl tryIndirectType()
    • setIndirectType

      private void setIndirectType(TypeCodeImpl newType)
    • setId

      private void setId(String newID)
    • setParent

      private void setParent(TypeCodeImpl parent)
    • getParentAtLevel

      private TypeCodeImpl getParentAtLevel(int level)
    • lazy_content_type

      private TypeCodeImpl lazy_content_type()
    • realType

      private TypeCode realType(TypeCode aType)
    • equal

      public final boolean equal(TypeCode tc)
      Description copied from class: TypeCode
      Compares this TypeCode object with the given one, testing for equality. TypeCode objects are equal if they are interchangeable and give identical results when TypeCode operations are applied to them.
      Specified by:
      equal in class TypeCode
      Parameters:
      tc - the TypeCode object to compare against
      Returns:
      true if the type codes are equal; false otherwise
    • equivalent

      public boolean equivalent(TypeCode tc)
      The equivalent operation is used by the ORB when determining type equivalence for values stored in an IDL any.
      Specified by:
      equivalent in class TypeCode
      Parameters:
      tc - the typecode to compare with this typecode
      Returns:
      true if the given typecode is equivalent to this typecode; false otherwise
      See Also:
    • get_compact_typecode

      public TypeCode get_compact_typecode()
      Description copied from class: TypeCode
      Strips out all optional name and member name fields, but leaves all alias typecodes intact.
      Specified by:
      get_compact_typecode in class TypeCode
      Returns:
      a TypeCode object with optional name and member name fields stripped out, except for alias typecodes, which are left intact
      See Also:
    • kind

      public TCKind kind()
      Description copied from class: TypeCode
      Retrieves the kind of this TypeCode object. The kind of a type code determines which TypeCode methods may legally be invoked on it.

      The method kind may be invoked on any TypeCode object.

      Specified by:
      kind in class TypeCode
      Returns:
      the TCKind instance indicating the value of the kind field of this TypeCode object
    • is_recursive

      public boolean is_recursive()
    • id

      public String id() throws BadKind
      Description copied from class: TypeCode
      Retrieves the RepositoryId globally identifying the type of this TypeCode object.

      The method id can be invoked on object reference, structure, union, enumeration, alias, exception, valuetype, boxed valuetype, native, and abstract interface type codes. Object reference, exception, valuetype, boxed valuetype, native, and abstract interface TypeCode objects always have a RepositoryId. Structure, union, enumeration, and alias TypeCode objects obtained from the Interface Repository or the method ORB.create_operation_list also always have a RepositoryId. If there is no RepositoryId, the method can return an empty string.

      Specified by:
      id in class TypeCode
      Returns:
      the RepositoryId for this TypeCode object or an empty string if there is no RepositoryID
      Throws:
      BadKind - if the method is invoked on an inappropriate kind ofTypeCode object
    • name

      public String name() throws BadKind
      Description copied from class: TypeCode
      Retrieves the simple name identifying this TypeCode object within its enclosing scope. Since names are local to a Repository, the name returned from a TypeCode object may not match the name of the type in any particular Repository, and may even be an empty string.

      The method name can be invoked on object reference, structure, union, enumeration, alias, exception, valuetype, boxed valuetype, native, and abstract interface TypeCode objects.

      Specified by:
      name in class TypeCode
      Returns:
      the name identifying this TypeCode object or an empty string
      Throws:
      BadKind - if the method is invoked on an inappropriate kind ofTypeCode object
    • member_count

      public int member_count() throws BadKind
      Description copied from class: TypeCode
      Retrieves the number of members in the type described by this TypeCode object.

      The method member_count can be invoked on structure, union, and enumeration TypeCode objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.

      Specified by:
      member_count in class TypeCode
      Returns:
      the number of members constituting the type described by this TypeCode object
      Throws:
      BadKind - if the method is invoked on an inappropriate kind of TypeCode object
    • member_name

      public String member_name(int index) throws BadKind, Bounds
      Description copied from class: TypeCode
      Retrieves the simple name of the member identified by the given index. Since names are local to a Repository, the name returned from a TypeCode object may not match the name of the member in any particular Repository, and may even be an empty string.

      The method member_name can be invoked on structure, union, and enumeration TypeCode objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.

      Specified by:
      member_name in class TypeCode
      Parameters:
      index - index of the member for which a name is being reqested
      Returns:
      simple name of the member identified by the index or an empty string
      Throws:
      BadKind - if the method is invoked on an inappropriate kind of TypeCode object
      Bounds - if the index is equal to or greater than the number of members constituting the type
    • member_type

      public TypeCode member_type(int index) throws BadKind, Bounds
      Description copied from class: TypeCode
      Retrieves the TypeCode object describing the type of the member identified by the given index.

      The method member_type can be invoked on structure and union TypeCode objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.

      Specified by:
      member_type in class TypeCode
      Parameters:
      index - index of the member for which type information is begin requested
      Returns:
      the TypeCode object describing the member at the given index
      Throws:
      BadKind - if the method is invoked on an inappropriate kind of TypeCode object
      Bounds - if the index is equal to or greater than the number of members constituting the type
    • member_label

      public Any member_label(int index) throws BadKind, Bounds
      Description copied from class: TypeCode
      Retrieves the label of the union member identified by the given index. For the default member, the label is the zero octet.

      The method member_label can only be invoked on union TypeCode objects.

      Specified by:
      member_label in class TypeCode
      Parameters:
      index - index of the union member for which the label is being requested
      Returns:
      an Any object describing the label of the requested union member or the zero octet for the default member
      Throws:
      BadKind - if the method is invoked on a non-union TypeCode object
      Bounds - if the index is equal to or greater than the number of members constituting the union
    • discriminator_type

      public TypeCode discriminator_type() throws BadKind
      Description copied from class: TypeCode
      Returns a TypeCode object describing all non-default member labels. The method discriminator_type can be invoked only on union TypeCode objects.
      Specified by:
      discriminator_type in class TypeCode
      Returns:
      the TypeCode object describing the non-default member labels
      Throws:
      BadKind - if the method is invoked on a non-union TypeCode object
    • default_index

      public int default_index() throws BadKind
      Description copied from class: TypeCode
      Returns the index of the default member, or -1 if there is no default member.

      The method default_index can be invoked only on union TypeCode objects.

      Specified by:
      default_index in class TypeCode
      Returns:
      the index of the default member, or -1 if there is no default member
      Throws:
      BadKind - if the method is invoked on a non-union TypeCode object
    • length

      public int length() throws BadKind
      Description copied from class: TypeCode
      Returns the number of elements in the type described by this TypeCode object. For strings and sequences, it returns the bound, with zero indicating an unbounded string or sequence. For arrays, it returns the number of elements in the array.

      The method length can be invoked on string, sequence, and array TypeCode objects.

      Specified by:
      length in class TypeCode
      Returns:
      the bound for strings and sequences, or the number of elements for arrays
      Throws:
      BadKind - if the method is invoked on an inappropriate kind of TypeCode object
    • content_type

      public TypeCode content_type() throws BadKind
      Description copied from class: TypeCode
      Returns the TypeCode object representing the IDL type for the members of the object described by this TypeCode object. For sequences and arrays, it returns the element type. For aliases, it returns the original type. Note that multidimensional arrays are represented by nesting TypeCode objects, one per dimension. For boxed valuetypes, it returns the boxed type.

      The method content_type can be invoked on sequence, array, alias, and boxed valuetype TypeCode objects.

      Specified by:
      content_type in class TypeCode
      Returns:
      a TypeCode object representing the element type for sequences and arrays, the original type for aliases, or the boxed type for boxed valuetypes.
      Throws:
      BadKind - if the method is invoked on an inappropriate kind of TypeCode object
    • fixed_digits

      public short fixed_digits() throws BadKind
      Description copied from class: TypeCode
      Returns the number of digits in the fixed type described by this TypeCode object. For example, the typecode for the number 3000.275d could be fixed<7,3>, where 7 is the precision and 3 is the scale.
      Specified by:
      fixed_digits in class TypeCode
      Returns:
      the total number of digits
      Throws:
      BadKind - if this method is invoked on an inappropriate kind of TypeCode object
    • fixed_scale

      public short fixed_scale() throws BadKind
      Description copied from class: TypeCode
      Returns the scale of the fixed type described by this TypeCode object. A positive number indicates the number of digits to the right of the decimal point. For example, the number 3000d could have the typecode fixed<4,0>, where the first number is the precision and the second number is the scale. A negative number is also possible and adds zeroes to the left of the decimal point. In this case, fixed<1,-3>, could be the typecode for the number 3000d.
      Specified by:
      fixed_scale in class TypeCode
      Returns:
      the scale of the fixed type that this TypeCode object describes
      Throws:
      BadKind - if this method is invoked on an inappropriate kind of TypeCode object
    • member_visibility

      public short member_visibility(int index) throws BadKind, Bounds
      Description copied from class: TypeCode
      Returns the constant that indicates the visibility of the member at the given index. This operation can only be invoked on non-boxed value TypeCode objects.
      Specified by:
      member_visibility in class TypeCode
      Parameters:
      index - an int indicating the index into the value
      Returns:
      either PRIVATE_MEMBER.value or PUBLIC_MEMBER.value
      Throws:
      BadKind - if this method is invoked on a non-value type TypeCode object
      Bounds - if the given index is out of bounds
      See Also:
    • type_modifier

      public short type_modifier() throws BadKind
      Description copied from class: TypeCode
      Returns a constant indicating the modifier of the value type that this TypeCode object describes. The constant returned must be one of the following: VM_NONE.value, VM_ABSTRACT.value, VM_CUSTOM.value, or VM_TRUNCATABLE.value,
      Specified by:
      type_modifier in class TypeCode
      Returns:
      a constant describing the value type that this TypeCode object describes
      Throws:
      BadKind - if this method is invoked on a non-value type TypeCode object
      See Also:
    • concrete_base_type

      public TypeCode concrete_base_type() throws BadKind
      Description copied from class: TypeCode
      Returns the TypeCode object that describes the concrete base type of the value type that this TypeCode object describes. Returns null if it doesn't have a concrete base type.
      Specified by:
      concrete_base_type in class TypeCode
      Returns:
      the TypeCode object that describes the concrete base type of the value type that this TypeCode object describes
      Throws:
      BadKind - if this method is invoked on a non-boxed value type TypeCode object
      See Also:
    • read_value

      public void read_value(InputStream is)
    • read_value_recursive

      private void read_value_recursive(TypeCodeInputStream is)
    • read_value_kind

      boolean read_value_kind(TypeCodeReader tcis)
    • read_value_kind

      void read_value_kind(InputStream is)
    • readValueBodySimple

      private void readValueBodySimple(InputStream is)
    • readValueBodyComplexObjref

      private void readValueBodyComplexObjref(TypeCodeInputStream _encap)
    • readValueBodyComplexUnion

      private void readValueBodyComplexUnion(InputStream is, TypeCodeInputStream _encap)
    • readValueBodyComplexEnum

      private void readValueBodyComplexEnum(TypeCodeInputStream _encap)
    • readValueBodyComplexSequence

      private void readValueBodyComplexSequence(InputStream is, TypeCodeInputStream _encap)
    • readValueBodyComplexArray

      private void readValueBodyComplexArray(InputStream is, TypeCodeInputStream _encap)
    • readValueBodyComplexAlias

      private void readValueBodyComplexAlias(InputStream is, TypeCodeInputStream _encap)
    • readValueBodyComplexStruct

      private void readValueBodyComplexStruct(InputStream is, TypeCodeInputStream _encap)
    • readValueBodyComplexValue

      private void readValueBodyComplexValue(InputStream is, TypeCodeInputStream _encap)
    • read_value_body

      void read_value_body(InputStream is)
    • write_value

      public void write_value(OutputStream os)
    • write_value

      public void write_value(TypeCodeOutputStream tcos)
    • copy

      protected void copy(InputStream src, OutputStream dst)
      This is not a copy of the TypeCodeImpl objects, but instead it copies the value this type code is representing. See AnyImpl read_value and write_value for usage. The state of this TypeCodeImpl instance isn't changed, only used by the Any to do the correct copy.
      Parameters:
      src - InputStream to copy.
      dst - target for copy.
    • digits

      protected static short digits(BigDecimal value)
    • scale

      protected static short scale(BigDecimal value)
    • currentUnionMemberIndex

      int currentUnionMemberIndex(Any discriminatorValue) throws BadKind
      Throws:
      BadKind
    • description

      public String description()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • printStream

      public void printStream(PrintStream s)
    • printStream

      private void printStream(PrintStream s, int level)
    • indent

      private String indent(int level)
    • setCaching

      protected void setCaching(boolean enableCaching)