org.jacorb.orb

Class TypeCode

Implemented Interfaces:
IDLEntity, java.io.Serializable

public class TypeCode
extends TypeCode

JacORB implementation of CORBA TypeCodes

Version:
$Id: TypeCode.java,v 1.38 2004/05/06 12:40:00 nicolas Exp $

Author:
Gerald Brose, FU Berlin

Constructor Summary

TypeCode(String id)
Constructor for recursive types
TypeCode(String _id, String _name, TypeCode _discriminator_type, UnionMember _members)
Constructor for tk_union
TypeCode(String id, String _name, short type_modifier, TypeCode concrete_base, ValueMember members)
Constructor for tk_value
TypeCode(int _kind)
Constructor for primitive types, called only from static initializer and org.jacorb.ir.TypeCodeUtil
TypeCode(int _kind, String _id, String _name, StructMember _members)
Constructor for tk_struct and tk_except
TypeCode(int _kind, String _id, String _name, TypeCode _original_type)
Constructor for tk_alias, tk_value_box
TypeCode(int _kind, int _bound)
Constructor for tk_string, tk_wstring
TypeCode(int _kind, int _bound, TypeCode _element_type)
Constructor for tk_sequence, tk_array
TypeCode(int _kind, java.lang.String _id, java.lang.String _name)
Constructor for tk_objref, tk_abstract_interface, tk_native, tk_local_interface
TypeCode(java.lang.String _id, java.lang.String _name, java.lang.String[] _members)
Constructor for tk_enum
TypeCode(short _digits, short _scale)
Constructor for tk_fixed

Method Summary

int
_kind()
TypeCode
concrete_base_type()
TypeCode
content_type()
static TypeCode
create_tc(Class clz)
Creates a TypeCode for an arbitrary Java class.
int
default_index()
TypeCode
discriminator_type()
boolean
equal(TypeCode tc)
check TypeCodes for equality
boolean
equivalent(TypeCode tc)
less strict equivalence check, unwinds aliases
short
fixed_digits()
short
fixed_scale()
TypeCode
get_compact_typecode()
get_compact_typecode returns a new TypeCode with all type and member information removed.
java.lang.String
id()
String
idlTypeName()
convenience method
static String
idlTypeName(TypeCode tc)
convenience method
static boolean
isRecursive(TypeCode tc)
boolean
is_primitive()
boolean
is_recursive()
TCKind
kind()
int
length()
int
member_count()
Any
member_label(int index)
java.lang.String
member_name(int index)
TypeCode
member_type(int index)
short
member_visibility(int index)
java.lang.String
name()
static TypeCode
originalType(TypeCode tc)
void
toSequence()
String
toString()
short
type_modifier()

Methods inherited from class org.omg.CORBA.TypeCode

concrete_base_type, content_type, default_index, discriminator_type, equal, equivalent, fixed_digits, fixed_scale, get_compact_typecode, id, kind, length, member_count, member_label, member_name, member_type, member_visibility, name, type_modifier

Constructor Details

TypeCode

public TypeCode(String id)
Constructor for recursive types


TypeCode

public TypeCode(String _id,
                String _name,
                TypeCode _discriminator_type,
                UnionMember _members)
Constructor for tk_union


TypeCode

public TypeCode(String id,
                String _name,
                short type_modifier,
                TypeCode concrete_base,
                ValueMember members)
Constructor for tk_value


TypeCode

public TypeCode(int _kind)
Constructor for primitive types, called only from static initializer and org.jacorb.ir.TypeCodeUtil


TypeCode

public TypeCode(int _kind,
                String _id,
                String _name,
                StructMember _members)
Constructor for tk_struct and tk_except


TypeCode

public TypeCode(int _kind,
                String _id,
                String _name,
                TypeCode _original_type)
Constructor for tk_alias, tk_value_box


TypeCode

public TypeCode(int _kind,
                int _bound)
Constructor for tk_string, tk_wstring


TypeCode

public TypeCode(int _kind,
                int _bound,
                TypeCode _element_type)
Constructor for tk_sequence, tk_array


TypeCode

public TypeCode(int _kind,
                java.lang.String _id,
                java.lang.String _name)
Constructor for tk_objref, tk_abstract_interface, tk_native, tk_local_interface


TypeCode

public TypeCode(java.lang.String _id,
                java.lang.String _name,
                java.lang.String[] _members)
Constructor for tk_enum


TypeCode

public TypeCode(short _digits,
                short _scale)
Constructor for tk_fixed

Method Details

_kind

public int _kind()


concrete_base_type

public TypeCode concrete_base_type()
            throws BadKind
Overrides:
concrete_base_type in interface TypeCode


content_type

public TypeCode content_type()
            throws BadKind
Overrides:
content_type in interface TypeCode


create_tc

public static TypeCode create_tc(Class clz)
Creates a TypeCode for an arbitrary Java class. Right now, this only covers RMI classes, not those derived from IDL.


default_index

public int default_index()
            throws BadKind
Overrides:
default_index in interface TypeCode


discriminator_type

public TypeCode discriminator_type()
            throws BadKind
Overrides:
discriminator_type in interface TypeCode


equal

public boolean equal(TypeCode tc)
check TypeCodes for equality
Overrides:
equal in interface TypeCode


equivalent

public boolean equivalent(TypeCode tc)
less strict equivalence check, unwinds aliases
Overrides:
equivalent in interface TypeCode


fixed_digits

public short fixed_digits()
            throws BadKind
Overrides:
fixed_digits in interface TypeCode


fixed_scale

public short fixed_scale()
            throws BadKind
Overrides:
fixed_scale in interface TypeCode


get_compact_typecode

public TypeCode get_compact_typecode()
get_compact_typecode returns a new TypeCode with all type and member information removed. RepositoryID and alias are preserved. This method effectively clones the original typecode - simpler than trying to work out what type so what to duplicate (and compact).
Overrides:
get_compact_typecode in interface TypeCode

Returns:
an org.omg.CORBA.TypeCode value


id

public java.lang.String id()
            throws BadKind
Overrides:
id in interface TypeCode


idlTypeName

public String idlTypeName()
convenience method


idlTypeName

public static String idlTypeName(TypeCode tc)
convenience method


isRecursive

public static boolean isRecursive(TypeCode tc)

Returns:
TRUE if the argument is a JacORB typecode and is recursive.


is_primitive

public boolean is_primitive()

Returns:
True if this TypeCode represents a primitive type, false otherwise


is_recursive

public boolean is_recursive()

Returns:
TRUE is this TypeCode is recursive. Both the initial place holder TypeCode and the real TypeCode which replaces the place holder return TRUE.


kind

public TCKind kind()
Overrides:
kind in interface TypeCode


length

public int length()
            throws BadKind
Overrides:
length in interface TypeCode


member_count

public int member_count()
            throws BadKind
Overrides:
member_count in interface TypeCode


member_label

public Any member_label(int index)
            throws BadKind,
                   Bounds
Overrides:
member_label in interface TypeCode


member_name

public java.lang.String member_name(int index)
            throws BadKind,
                   Bounds
Overrides:
member_name in interface TypeCode


member_type

public TypeCode member_type(int index)
            throws BadKind,
                   Bounds
Overrides:
member_type in interface TypeCode


member_visibility

public short member_visibility(int index)
            throws BadKind,
                   Bounds
Overrides:
member_visibility in interface TypeCode


name

public java.lang.String name()
            throws BadKind
Overrides:
name in interface TypeCode


originalType

public static TypeCode originalType(TypeCode tc)

Returns:
the content type if the argument is an alias, or the argument itself otherwise


toSequence

public void toSequence()


toString

public String toString()


type_modifier

public short type_modifier()
            throws BadKind
Overrides:
type_modifier in interface TypeCode