org.jacorb.orb
Class TypeCode

java.lang.Object
  extended byorg.omg.CORBA.TypeCode
      extended byorg.jacorb.orb.TypeCode
All Implemented Interfaces:
IDLEntity, java.io.Serializable

public class TypeCode
extends TypeCode

JacORB implementation of CORBA TypeCodes

Version:
$Id: TypeCode.java,v 1.41 2006/04/26 15:35:48 andre.spiegel Exp $
Author:
Gerald Brose, FU Berlin
See Also:
Serialized Form

Constructor Summary
TypeCode(int _kind)
          Constructor for primitive types, called only from static initializer and org.jacorb.ir.TypeCodeUtil
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(int _kind, java.lang.String _id, java.lang.String _name, StructMember[] _members)
          Constructor for tk_struct and tk_except
TypeCode(int _kind, java.lang.String _id, java.lang.String _name, TypeCode _original_type)
          Constructor for tk_alias, tk_value_box
TypeCode(short _digits, short _scale)
          Constructor for tk_fixed
TypeCode(java.lang.String id)
          Constructor for recursive types
TypeCode(java.lang.String id, java.lang.String _name, short type_modifier, TypeCode concrete_base, ValueMember[] members)
          Constructor for tk_value
TypeCode(java.lang.String _id, java.lang.String _name, java.lang.String[] _members)
          Constructor for tk_enum
TypeCode(java.lang.String _id, java.lang.String _name, TypeCode _discriminator_type, UnionMember[] _members)
          Constructor for tk_union
 
Method Summary
 int _kind()
           
 TypeCode concrete_base_type()
           
 TypeCode content_type()
           
static TypeCode create_tc(java.lang.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()
           
 java.lang.String idlTypeName()
          convenience method
static java.lang.String idlTypeName(TypeCode tc)
          convenience method
 boolean is_primitive()
           
 boolean is_recursive()
           
static boolean isRecursive(TypeCode tc)
           
 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()
           
 java.lang.String toString()
           
 short type_modifier()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeCode

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


TypeCode

public TypeCode(java.lang.String id)
Constructor for recursive types


TypeCode

public TypeCode(int _kind,
                java.lang.String _id,
                java.lang.String _name,
                StructMember[] _members)
Constructor for tk_struct and tk_except


TypeCode

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


TypeCode

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


TypeCode

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


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(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(short _digits,
                short _scale)
Constructor for tk_fixed


TypeCode

public TypeCode(java.lang.String id,
                java.lang.String _name,
                short type_modifier,
                TypeCode concrete_base,
                ValueMember[] members)
Constructor for tk_value

Method Detail

is_primitive

public boolean is_primitive()
Returns:
True if this TypeCode represents a primitive type, false otherwise

equal

public boolean equal(TypeCode tc)
check TypeCodes for equality

Specified by:
equal in class TypeCode

kind

public TCKind kind()
Specified by:
kind in class TypeCode

_kind

public int _kind()

id

public java.lang.String id()
                    throws BadKind
Specified by:
id in class TypeCode
Throws:
BadKind

name

public java.lang.String name()
                      throws BadKind
Specified by:
name in class TypeCode
Throws:
BadKind

member_count

public int member_count()
                 throws BadKind
Specified by:
member_count in class TypeCode
Throws:
BadKind

member_name

public java.lang.String member_name(int index)
                             throws BadKind,
                                    Bounds
Specified by:
member_name in class TypeCode
Throws:
BadKind
Bounds

member_type

public TypeCode member_type(int index)
                     throws BadKind,
                            Bounds
Specified by:
member_type in class TypeCode
Throws:
BadKind
Bounds

member_label

public Any member_label(int index)
                 throws BadKind,
                        Bounds
Specified by:
member_label in class TypeCode
Throws:
BadKind
Bounds

discriminator_type

public TypeCode discriminator_type()
                            throws BadKind
Specified by:
discriminator_type in class TypeCode
Throws:
BadKind

default_index

public int default_index()
                  throws BadKind
Specified by:
default_index in class TypeCode
Throws:
BadKind

length

public int length()
           throws BadKind
Specified by:
length in class TypeCode
Throws:
BadKind

content_type

public TypeCode content_type()
                      throws BadKind
Specified by:
content_type in class TypeCode
Throws:
BadKind

fixed_digits

public short fixed_digits()
                   throws BadKind
Overrides:
fixed_digits in class TypeCode
Throws:
BadKind

fixed_scale

public short fixed_scale()
                  throws BadKind
Overrides:
fixed_scale in class TypeCode
Throws:
BadKind

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).

Specified by:
get_compact_typecode in class TypeCode
Returns:
an org.omg.CORBA.TypeCode value

member_visibility

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

type_modifier

public short type_modifier()
                    throws BadKind
Overrides:
type_modifier in class TypeCode
Throws:
BadKind

concrete_base_type

public TypeCode concrete_base_type()
                            throws BadKind
Overrides:
concrete_base_type in class TypeCode
Throws:
BadKind

equivalent

public boolean equivalent(TypeCode tc)
less strict equivalence check, unwinds aliases

Specified by:
equivalent in class TypeCode

toSequence

public void toSequence()

toString

public java.lang.String toString()

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.

isRecursive

public static boolean isRecursive(TypeCode tc)
Returns:
TRUE if the argument is a JacORB typecode and is recursive.

idlTypeName

public static java.lang.String idlTypeName(TypeCode tc)
convenience method


idlTypeName

public java.lang.String idlTypeName()
convenience method


originalType

public static TypeCode originalType(TypeCode tc)
Returns:
the content type if the argument is an alias, or the argument itself otherwise

create_tc

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