Class TypeCodeImpl
- All Implemented Interfaces:
Serializable
,IDLEntity
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TypeCodeImpl
private TypeCodeImpl
private int
private short
private TypeCodeImpl
private String
private TypeCodeImpl
private int
private int
private short[]
private int
private String[]
private TypeCodeImpl[]
private String
private ORB
private TypeCodeImpl
private int
private short
private short
private AnyImpl[]
private boolean
private static final int
private static final int
(package private) static final String[]
private byte[]
private static final long
private static final int
private static final int
private static final int[]
private static final ORBUtilSystemException
-
Constructor Summary
ConstructorsConstructorDescriptionTypeCodeImpl
(ORB orb) TypeCodeImpl
(ORB orb, int creationKind) TypeCodeImpl
(ORB orb, int creationKind, int bound) TypeCodeImpl
(ORB orb, int creationKind, int bound, int offset) TypeCodeImpl
(ORB orb, int creationKind, int bound, TypeCode element_type) TypeCodeImpl
(ORB orb, int creationKind, short digits, short scale) TypeCodeImpl
(ORB orb, int creationKind, String id, String name) TypeCodeImpl
(ORB orb, int creationKind, String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members) TypeCodeImpl
(ORB orb, int creationKind, String id, String name, String[] members) TypeCodeImpl
(ORB orb, int creationKind, String id, String name, StructMember[] members) TypeCodeImpl
(ORB orb, int creationKind, String id, String name, TypeCode original_type) TypeCodeImpl
(ORB orb, int creationKind, String id, String name, TypeCode discriminator_type, UnionMember[] members) TypeCodeImpl
(ORB orb, String id) TypeCodeImpl
(ORB orb, TypeCode tc) -
Method Summary
Modifier and TypeMethodDescriptionReturns theTypeCode
object that describes the concrete base type of the value type that thisTypeCode
object describes.Returns theTypeCode
object representing the IDL type for the members of the object described by thisTypeCode
object.protected static TypeCodeImpl
convertToNative
(ORB orb, TypeCode tc) 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.private void
createAliasTypeCode
(ORB orb, int creationKind, String id, String name, TypeCode original_type) private void
createArrayTypeCode
(ORB orb, int creationKind, int bound, TypeCode element_type) private void
createEnumTypeCode
(ORB orb, int creationKind, String id, String name, String[] members) private void
createFixedTypeCode
(ORB orb, int creationKind, short digits, short scale) private void
createFromNonNativeTypeCode
(ORB orb, TypeCode tc) private void
createObjrefTypeCode
(ORB orb, int creationKind, String id, String name) private void
createPrimitiveTypeCode
(ORB orb, int creationKind) private void
createRecursiveSequenceTypeCode
(ORB orb, int creationKind, int bound, int offset) private void
createRecursiveTypeCode
(ORB orb, String id) private void
createStringTypeCode
(ORB orb, int creationKind, int bound) private void
createStructTypeCode
(ORB orb, int creationKind, String id, String name, StructMember[] members) private void
createUnionTypeCode
(ORB orb, int creationKind, String id, String name, TypeCode discriminator_type, UnionMember[] members) private void
createValueTypeCode
(ORB orb, int creationKind, String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members) (package private) int
currentUnionMemberIndex
(Any discriminatorValue) int
Returns the index of the default member, or -1 if there is no default member.protected static short
digits
(BigDecimal value) Returns aTypeCode
object describing all non-default member labels.final boolean
Compares thisTypeCode
object with the given one, testing for equality.boolean
equivalent
(TypeCode tc) The equivalent operation is used by the ORB when determining type equivalence for values stored in an IDL any.short
Returns the number of digits in the fixed type described by thisTypeCode
object.short
Returns the scale of the fixed type described by thisTypeCode
object.Strips out all optional name and member name fields, but leaves all alias typecodes intact.private TypeCodeImpl
getParentAtLevel
(int level) id()
Retrieves the RepositoryId globally identifying the type of thisTypeCode
object.private String
indent
(int level) private TypeCodeImpl
boolean
kind()
Retrieves the kind of thisTypeCode
object.private TypeCodeImpl
int
length()
Returns the number of elements in the type described by thisTypeCode
object.int
Retrieves the number of members in the type described by thisTypeCode
object.member_label
(int index) Retrieves the label of the union member identified by the given index.member_name
(int index) Retrieves the simple name of the member identified by the given index.member_type
(int index) Retrieves theTypeCode
object describing the type of the member identified by the given index.short
member_visibility
(int index) Returns the constant that indicates the visibility of the member at the given index.name()
Retrieves the simple name identifying thisTypeCode
object within its enclosing scope.static CDROutputObject
newOutputStream
(ORB orb) void
private void
printStream
(PrintStream s, int level) void
(package private) void
(package private) boolean
(package private) void
private void
private void
private void
readValueBodyComplexAlias
(InputStream is, TypeCodeInputStream _encap) private void
readValueBodyComplexArray
(InputStream is, TypeCodeInputStream _encap) private void
private void
private void
private void
readValueBodyComplexStruct
(InputStream is, TypeCodeInputStream _encap) private void
readValueBodyComplexUnion
(InputStream is, TypeCodeInputStream _encap) private void
readValueBodyComplexValue
(InputStream is, TypeCodeInputStream _encap) private void
private TypeCode
protected static short
scale
(BigDecimal value) protected void
setCaching
(boolean enableCaching) private void
private void
setIndirectType
(TypeCodeImpl newType) private void
setParent
(TypeCodeImpl parent) toString()
private TypeCodeImpl
short
Returns a constant indicating the modifier of the value type that thisTypeCode
object describes.void
void
-
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
-
_kind
private int _kind -
_id
-
_name
-
_memberCount
private int _memberCount -
_memberNames
-
_memberTypes
-
_unionLabels
-
_discriminator
-
_defaultIndex
private int _defaultIndex -
_length
private int _length -
_contentType
-
_digits
private short _digits -
_scale
private short _scale -
_type_modifier
private short _type_modifier -
_concrete_base
-
_memberAccess
private short[] _memberAccess -
_parent
-
_parentOffset
private int _parentOffset -
_indirectType
-
outBuffer
private byte[] outBuffer -
cachingEnabled
private boolean cachingEnabled -
_orb
-
wrapper
-
-
Constructor Details
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
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
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
TypeCodeImpl
-
-
Method Details
-
readObject
- Throws:
IOException
ClassNotFoundException
-
createFromNonNativeTypeCode
-
createPrimitiveTypeCode
-
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
-
createAliasTypeCode
-
createObjrefTypeCode
-
createStringTypeCode
-
createArrayTypeCode
-
createRecursiveSequenceTypeCode
-
createRecursiveTypeCode
-
createFixedTypeCode
-
convertToNative
-
newOutputStream
-
indirectType
-
tryIndirectType
-
setIndirectType
-
setId
-
setParent
-
getParentAtLevel
-
lazy_content_type
-
realType
-
equal
Description copied from class:TypeCode
Compares thisTypeCode
object with the given one, testing for equality.TypeCode
objects are equal if they are interchangeable and give identical results whenTypeCode
operations are applied to them. -
equivalent
The equivalent operation is used by the ORB when determining type equivalence for values stored in an IDL any.- Specified by:
equivalent
in classTypeCode
- 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
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 classTypeCode
- Returns:
- a
TypeCode
object with optional name and member name fields stripped out, except for alias typecodes, which are left intact - See Also:
-
kind
Description copied from class:TypeCode
Retrieves the kind of thisTypeCode
object. The kind of a type code determines whichTypeCode
methods may legally be invoked on it.The method
kind
may be invoked on anyTypeCode
object. -
is_recursive
public boolean is_recursive() -
id
Description copied from class:TypeCode
Retrieves the RepositoryId globally identifying the type of thisTypeCode
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 interfaceTypeCode
objects always have a RepositoryId. Structure, union, enumeration, and aliasTypeCode
objects obtained from the Interface Repository or the methodORB.create_operation_list
also always have a RepositoryId. If there is no RepositoryId, the method can return an empty string. -
name
Description copied from class:TypeCode
Retrieves the simple name identifying thisTypeCode
object within its enclosing scope. Since names are local to a Repository, the name returned from aTypeCode
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 interfaceTypeCode
objects. -
member_count
Description copied from class:TypeCode
Retrieves the number of members in the type described by thisTypeCode
object.The method
member_count
can be invoked on structure, union, and enumerationTypeCode
objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.- Specified by:
member_count
in classTypeCode
- Returns:
- the number of members constituting the type described
by this
TypeCode
object - Throws:
BadKind
- if the method is invoked on an inappropriate kind ofTypeCode
object
-
member_name
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 aTypeCode
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 enumerationTypeCode
objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.- Specified by:
member_name
in classTypeCode
- 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 ofTypeCode
objectBounds
- if the index is equal to or greater than the number of members constituting the type
-
member_type
Description copied from class:TypeCode
Retrieves theTypeCode
object describing the type of the member identified by the given index.The method
member_type
can be invoked on structure and unionTypeCode
objects. Java IDL extends the CORBA specification to allow this method to operate on exceptions as well.- Specified by:
member_type
in classTypeCode
- 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 ofTypeCode
objectBounds
- if the index is equal to or greater than the number of members constituting the type
-
member_label
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 unionTypeCode
objects.- Specified by:
member_label
in classTypeCode
- 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-unionTypeCode
objectBounds
- if the index is equal to or greater than the number of members constituting the union
-
discriminator_type
Description copied from class:TypeCode
Returns aTypeCode
object describing all non-default member labels. The methoddiscriminator_type
can be invoked only on unionTypeCode
objects.- Specified by:
discriminator_type
in classTypeCode
- Returns:
- the
TypeCode
object describing the non-default member labels - Throws:
BadKind
- if the method is invoked on a non-unionTypeCode
object
-
default_index
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 unionTypeCode
objects.- Specified by:
default_index
in classTypeCode
- 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-unionTypeCode
object
-
length
Description copied from class:TypeCode
Returns the number of elements in the type described by thisTypeCode
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 arrayTypeCode
objects. -
content_type
Description copied from class:TypeCode
Returns theTypeCode
object representing the IDL type for the members of the object described by thisTypeCode
object. For sequences and arrays, it returns the element type. For aliases, it returns the original type. Note that multidimensional arrays are represented by nestingTypeCode
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 valuetypeTypeCode
objects.- Specified by:
content_type
in classTypeCode
- 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 ofTypeCode
object
-
fixed_digits
Description copied from class:TypeCode
Returns the number of digits in the fixed type described by thisTypeCode
object. For example, the typecode for the number 3000.275d could befixed<7,3>
, where 7 is the precision and 3 is the scale.- Specified by:
fixed_digits
in classTypeCode
- Returns:
- the total number of digits
- Throws:
BadKind
- if this method is invoked on an inappropriate kind ofTypeCode
object
-
fixed_scale
Description copied from class:TypeCode
Returns the scale of the fixed type described by thisTypeCode
object. A positive number indicates the number of digits to the right of the decimal point. For example, the number 3000d could have the typecodefixed<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 classTypeCode
- Returns:
- the scale of the fixed type that this
TypeCode
object describes - Throws:
BadKind
- if this method is invoked on an inappropriate kind ofTypeCode
object
-
member_visibility
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 valueTypeCode
objects.- Specified by:
member_visibility
in classTypeCode
- Parameters:
index
- anint
indicating the index into the value- Returns:
- either
PRIVATE_MEMBER.value
orPUBLIC_MEMBER.value
- Throws:
BadKind
- if this method is invoked on a non-value typeTypeCode
objectBounds
- if the given index is out of bounds- See Also:
-
type_modifier
Description copied from class:TypeCode
Returns a constant indicating the modifier of the value type that thisTypeCode
object describes. The constant returned must be one of the following:VM_NONE.value
,VM_ABSTRACT.value
,VM_CUSTOM.value
, orVM_TRUNCATABLE.value
,- Specified by:
type_modifier
in classTypeCode
- Returns:
- a constant describing the value type
that this
TypeCode
object describes - Throws:
BadKind
- if this method is invoked on a non-value typeTypeCode
object- See Also:
-
concrete_base_type
Description copied from class:TypeCode
Returns theTypeCode
object that describes the concrete base type of the value type that thisTypeCode
object describes. Returns null if it doesn't have a concrete base type.- Specified by:
concrete_base_type
in classTypeCode
- Returns:
- the
TypeCode
object that describes the concrete base type of the value type that thisTypeCode
object describes - Throws:
BadKind
- if this method is invoked on a non-boxed value typeTypeCode
object- See Also:
-
read_value
-
read_value_recursive
-
read_value_kind
-
read_value_kind
-
readValueBodySimple
-
readValueBodyComplexObjref
-
readValueBodyComplexUnion
-
readValueBodyComplexEnum
-
readValueBodyComplexSequence
-
readValueBodyComplexArray
-
readValueBodyComplexAlias
-
readValueBodyComplexStruct
-
readValueBodyComplexValue
-
read_value_body
-
write_value
-
write_value
-
copy
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
-
scale
-
currentUnionMemberIndex
- Throws:
BadKind
-
description
-
toString
-
printStream
-
printStream
-
indent
-
setCaching
protected void setCaching(boolean enableCaching)
-