Class Type
- java.lang.Object
-
- org.glassfish.rmic.iiop.Type
-
- All Implemented Interfaces:
java.lang.Cloneable,Constants,Constants,ContextElement,Constants,RuntimeConstants
- Direct Known Subclasses:
ArrayType,CompoundType,PrimitiveType
public abstract class Type extends java.lang.Object implements Constants, ContextElement, java.lang.Cloneable
Type is an abstract base class for a family of types which provide conformance checking and name mapping as defined in the "Java to IDL Mapping" OMG specification. The family is composed of the following fixed set of types:+- RemoteType <-- AbstractType | +- InterfaceType <-+- SpecialInterfaceType +- PrimitiveType | | | | +- NCInterfaceType Type <-+- CompoundType <-| | | +- ValueType +- ArrayType | | +- ClassType <-----+- ImplementationType | +- SpecialClassType | +- NCClassTypePrimitiveType represents a primitive or a void type.CompoundType is an abstract base representing any non-special class or interface type.
InterfaceType is an abstract base representing any non-special interface type.
RemoteType represents any non-special interface which inherits from java.rmi.Remote.
AbstractType represents any non-special interface which does not inherit from java.rmi.Remote, for which all methods throw RemoteException.
SpecialInterfaceType represents any one of the following types:
java.rmi.Remote java.io.Serializable java.io.Externalizableall of which are treated as special cases.NCInterfaceType represents any non-special, non-conforming interface.
ClassType is an abstract base representing any non-special class type.
ValueType represents any non-special class which does inherit from java.io.Serializable and does not inherit from java.rmi.Remote.
ImplementationType represents any non-special class which implements one or more interfaces which inherit from java.rmi.Remote.
SpecialClassType represents any one of the following types:
java.lang.Object java.lang.String org.omg.CORBA.Objectall of which are treated as special cases. For all but CORBA.Object, the type must match exactly. For CORBA.Object, the type must either be CORBA.Object or inherit from it.NCClassType represents any non-special, non-conforming class.
ArrayType is a wrapper for any of the other types. The getElementType() method can be used to get the array element type. The getArrayDimension() method can be used to get the array dimension.
NOTE: None of these types is multi-thread-safe
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandestroyedprotected BatchEnvironmentenvprivate intfullTypeCodeprivate Identifieridprivate java.lang.String[]idlModuleNamesprivate java.lang.StringidlNameprivate java.lang.Stringnameprivate java.lang.Class<?>ourClassprivate java.lang.StringpackageNameprivate java.lang.StringqualifiedIDLNameprivate java.lang.StringqualifiedNameprivate java.lang.StringrepositoryIDprotected ContextStackstackprivate intstatusprivate inttypeCode-
Fields inherited from interface org.glassfish.rmic.Constants
idRemote, idRemoteException
-
Fields inherited from interface org.glassfish.rmic.iiop.Constants
ATTRIBUTE_GET, ATTRIBUTE_GET_RW, ATTRIBUTE_IS, ATTRIBUTE_IS_RW, ATTRIBUTE_NONE, ATTRIBUTE_SET, ATTRIBUTE_WIRE_PREFIX, ERROR_SUFFIX, EX_SUFFIX, EXCEPTION_SUFFIX, idApplicationException, idBadMethodException, idBoolean, idBoxedIDL, idBoxedRMI, idByte, idChar, idClassDesc, idCorbaObject, idCorbaORB, idCorbaUserException, idDelegate, idDouble, idExtInputStream, idExtOutputStream, idFloat, idIDLEntity, idInputStream, idInt, idJavaIoExternalizable, idJavaIoIOException, IDL_ANY, IDL_BOOLEAN, IDL_BOXEDIDL_MODULE, IDL_BYTE, IDL_CHAR, IDL_CLASS, IDL_CLASS_MODULE, IDL_CONSTANT_STRING, IDL_CONSTRUCTOR, IDL_CORBA_MODULE, IDL_CORBA_OBJECT, IDL_DOUBLE, IDL_EXTERNALIZABLE, IDL_FILE_EXTENSION, IDL_FLOAT, IDL_IDLENTITY, IDL_INT, IDL_JAVA_IO_MODULE, IDL_JAVA_LANG_MODULE, IDL_JAVA_LANG_OBJECT, IDL_JAVA_RMI_MODULE, IDL_JAVA_RMI_REMOTE, IDL_KEYWORDS, IDL_LONG, IDL_NAME_SEPARATOR, IDL_ORG_OMG_CORBA_MODULE, IDL_ORG_OMG_CORBA_PORTABLE_MODULE, IDL_REPOSITORY_ID_PREFIX, IDL_REPOSITORY_ID_VERSION, IDL_SEQUENCE, IDL_SEQUENCE_MODULE, IDL_SERIALIZABLE, IDL_SHORT, IDL_STRING, IDL_VOID, idLong, idOutputStream, idPOAServantType, idPortableUnknownException, idRemarshalException, idReplyHandler, idShort, idStubBase, idSystemException, idTieBase, idTieInterface, idValueBase, idVoid, INDENT_STEP, NAME_SEPARATOR, SERIAL_VERSION_UID, SOURCE_FILE_EXTENSION, STATUS_INVALID, STATUS_PENDING, STATUS_VALID, TAB_SIZE, TM_CLASS, TM_COMPOUND, TM_INNER, TM_INTERFACE, TM_MASK, TM_NON_CONFORMING, TM_PRIMITIVE, TM_SPECIAL_CLASS, TM_SPECIAL_INTERFACE, TYPE_ABSTRACT, TYPE_ALL, TYPE_ANY, TYPE_ARRAY, TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHAR, TYPE_CORBA_OBJECT, TYPE_DOUBLE, TYPE_FLOAT, TYPE_IMPLEMENTATION, TYPE_INT, TYPE_JAVA_RMI_REMOTE, TYPE_LONG, TYPE_MASK, TYPE_NC_CLASS, TYPE_NC_INTERFACE, TYPE_NONE, TYPE_REMOTE, TYPE_SHORT, TYPE_STRING, TYPE_VALUE, TYPE_VOID
-
Fields inherited from interface org.glassfish.rmic.tools.java.Constants
ABSTRACT, ACCM_CLASS, ACCM_FIELD, ACCM_INNERCLASS, ACCM_MEMBER, ACCM_METHOD, ADD, AND, ARRAY, ARRAYACCESS, ASGADD, ASGBITAND, ASGBITOR, ASGBITXOR, ASGDIV, ASGLSHIFT, ASGMUL, ASGREM, ASGRSHIFT, ASGSUB, ASGURSHIFT, ASSIGN, ATT_ALL, ATT_ALLCLASSES, ATT_CODE, BITAND, BITNOT, BITOR, BITXOR, BOOLEAN, BOOLEANVAL, BREAK, BYTE, BYTEVAL, CASE, CAST, CATCH, CHAR, CHARVAL, CLASS, COLON, COMMA, COMMENT, COND, CONST, CONTINUE, CONVERT, CS_BINARY, CS_CHECKED, CS_COMPILED, CS_NOTFOUND, CS_PARSED, CS_SOURCE, CS_UNDECIDED, CS_UNDEFINED, CT_BLOCK, CT_BRANCH_FALSE, CT_BRANCH_TRUE, CT_CASE, CT_FIKT_METHOD, CT_FIKT_RET, CT_FIRST_KIND, CT_LAST_KIND, CT_METHOD, CT_SWITH_WO_DEF, DEC, DECLARATION, DEFAULT, DIV, DO, DOUBLE, DOUBLEVAL, ELSE, EQ, ERROR, EXPR, EXPRESSION, EXTENDS, F_COVDATA, F_COVERAGE, F_DEBUG_LINES, F_DEBUG_SOURCE, F_DEBUG_VARS, F_DEPENDENCIES, F_DEPRECATION, F_DUMP, F_ERRORSREPORTED, F_OPT, F_OPT_INTERCLASS, F_PRINT_DEPENDENCIES, F_STRICTDEFAULT, F_VERBOSE, F_VERSION12, F_WARNINGS, FALSE, FIELD, FINAL, FINALLY, FLOAT, FLOATVAL, FOR, GE, GOTO, GT, idAppend, idClass, idClassInit, idClone, idCode, idConstantValue, idCoverageTable, idDeprecated, idDocumentation, IDENT, idExceptions, idFinallyReturnValue, idGetClass, idInit, idInnerClasses, idJavaIoSerializable, idJavaLang, idJavaLangClass, idJavaLangCloneable, idJavaLangError, idJavaLangException, idJavaLangObject, idJavaLangRuntimeException, idJavaLangString, idJavaLangStringBuffer, idJavaLangThrowable, idLength, idLineNumberTable, idLocalVariableTable, idNew, idNull, idSourceFile, idStar, idSuper, idSynthetic, idThis, idToString, idTYPE, idValueOf, IF, IMPLEMENTS, IMPORT, INC, INLINEMETHOD, INLINENEWINSTANCE, INLINERETURN, INSTANCEOF, INT, INTERFACE, INTVAL, LBRACE, LE, LENGTH, LONG, LONGVAL, LPAREN, LSHIFT, LSQBRACKET, LT, M_ABSTRACT, M_ANONYMOUS, M_DEPRECATED, M_FINAL, M_INLINEABLE, M_INTERFACE, M_LOCAL, M_NATIVE, M_PRIVATE, M_PROTECTED, M_PUBLIC, M_STATIC, M_STRICTFP, M_SYNCHRONIZED, M_SYNTHETIC, M_TRANSIENT, M_VOLATILE, MAXFILESIZE, MAXLINENUMBER, METHOD, MM_CLASS, MM_FIELD, MM_MEMBER, MM_METHOD, MUL, NATIVE, NE, NEG, NEW, NEWARRAY, NEWFROMNAME, NEWINSTANCE, NOT, NULL, opNames, opPrecedence, OR, PACKAGE, paraDeprecated, POS, POSTDEC, POSTINC, PREDEC, prefixAccess, prefixArray, prefixClass, prefixLoc, prefixThis, prefixVal, PREINC, PRIVATE, PROTECTED, PUBLIC, QUESTIONMARK, RBRACE, REM, RETURN, RPAREN, RSHIFT, RSQBRACKET, SEMICOLON, SHORT, SHORTVAL, SIG_INNERCLASS, SIGC_INNERCLASS, STAT, STATIC, STRICTFP, STRINGVAL, SUB, SUPER, SWITCH, SYNCHRONIZED, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_DOUBLE, TC_ERROR, TC_FLOAT, TC_INT, TC_LONG, TC_METHOD, TC_NULL, TC_SHORT, TC_VOID, THIS, THROW, THROWS, TM_ARRAY, TM_BOOLEAN, TM_BYTE, TM_CHAR, TM_DOUBLE, TM_ERROR, TM_FLOAT, TM_INT, TM_INT32, TM_INTEGER, TM_LONG, TM_METHOD, TM_NULL, TM_NUM32, TM_NUM64, TM_NUMBER, TM_REAL, TM_REFERENCE, TM_SHORT, TM_VOID, tracing, TRANSIENT, TRUE, TRY, TYPE, URSHIFT, VARDECLARATION, VOID, VOLATILE, WHEREOFFSETBITS, WHILE
-
Fields inherited from interface org.glassfish.rmic.tools.java.RuntimeConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELD, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACEMETHOD, CONSTANT_INVOKEDYNAMIC, CONSTANT_LONG, CONSTANT_METHOD, CONSTANT_METHODHANDLE, CONSTANT_METHODTYPE, CONSTANT_NAMEANDTYPE, CONSTANT_STRING, CONSTANT_UNICODE, CONSTANT_UTF8, JAVA_DEFAULT_MINOR_VERSION, JAVA_DEFAULT_VERSION, JAVA_MAGIC, JAVA_MAX_SUPPORTED_MINOR_VERSION, JAVA_MAX_SUPPORTED_VERSION, JAVA_MIN_SUPPORTED_VERSION, opc_aaload, opc_aastore, opc_aconst_null, opc_aload, opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3, opc_anewarray, opc_areturn, opc_arraylength, opc_astore, opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3, opc_athrow, opc_baload, opc_bastore, opc_bipush, opc_breakpoint, opc_caload, opc_castore, opc_checkcast, opc_d2f, opc_d2i, opc_d2l, opc_dadd, opc_daload, opc_dastore, opc_dcmpg, opc_dcmpl, opc_dconst_0, opc_dconst_1, opc_ddiv, opc_dead, opc_dload, opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3, opc_dmul, opc_dneg, opc_drem, opc_dreturn, opc_dstore, opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3, opc_dsub, opc_dup, opc_dup_x1, opc_dup_x2, opc_dup2, opc_dup2_x1, opc_dup2_x2, opc_f2d, opc_f2i, opc_f2l, opc_fadd, opc_faload, opc_fastore, opc_fcmpg, opc_fcmpl, opc_fconst_0, opc_fconst_1, opc_fconst_2, opc_fdiv, opc_fload, opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3, opc_fmul, opc_fneg, opc_frem, opc_freturn, opc_fstore, opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3, opc_fsub, opc_getfield, opc_getstatic, opc_goto, opc_goto_w, opc_i2b, opc_i2c, opc_i2d, opc_i2f, opc_i2l, opc_i2s, opc_iadd, opc_iaload, opc_iand, opc_iastore, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5, opc_iconst_m1, opc_idiv, opc_if_acmpeq, opc_if_acmpne, opc_if_icmpeq, opc_if_icmpge, opc_if_icmpgt, opc_if_icmple, opc_if_icmplt, opc_if_icmpne, opc_ifeq, opc_ifge, opc_ifgt, opc_ifle, opc_iflt, opc_ifne, opc_ifnonnull, opc_ifnull, opc_iinc, opc_iload, opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3, opc_imul, opc_ineg, opc_instanceof, opc_invokedynamic, opc_invokeinterface, opc_invokespecial, opc_invokestatic, opc_invokevirtual, opc_ior, opc_irem, opc_ireturn, opc_ishl, opc_ishr, opc_istore, opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3, opc_isub, opc_iushr, opc_ixor, opc_jsr, opc_jsr_w, opc_l2d, opc_l2f, opc_l2i, opc_label, opc_ladd, opc_laload, opc_land, opc_lastore, opc_lcmp, opc_lconst_0, opc_lconst_1, opc_ldc, opc_ldc_w, opc_ldc2_w, opc_ldiv, opc_lload, opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3, opc_lmul, opc_lneg, opc_lookupswitch, opc_lor, opc_lrem, opc_lreturn, opc_lshl, opc_lshr, opc_lstore, opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3, opc_lsub, opc_lushr, opc_lxor, opc_monitorenter, opc_monitorexit, opc_multianewarray, opc_new, opc_newarray, opc_nop, opc_pop, opc_pop2, opc_putfield, opc_putstatic, opc_ret, opc_return, opc_saload, opc_sastore, opc_sipush, opc_swap, opc_tableswitch, opc_try, opc_wide, opcLengths, opcNames, SIG_ARRAY, SIG_BOOLEAN, SIG_BYTE, SIG_CHAR, SIG_CLASS, SIG_DOUBLE, SIG_ENDCLASS, SIG_ENDMETHOD, SIG_FLOAT, SIG_INT, SIG_LONG, SIG_METHOD, SIG_PACKAGE, SIG_SHORT, SIG_VOID, SIGC_ARRAY, SIGC_BOOLEAN, SIGC_BYTE, SIGC_CHAR, SIGC_CLASS, SIGC_DOUBLE, SIGC_ENDCLASS, SIGC_ENDMETHOD, SIGC_FLOAT, SIGC_INT, SIGC_LONG, SIGC_METHOD, SIGC_PACKAGE, SIGC_SHORT, SIGC_VOID, T_BOOLEAN, T_BYTE, T_CHAR, T_CLASS, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT
-
-
Constructor Summary
Constructors Modifier Constructor Description privateType()protectedType(ContextStack stack, int fullTypeCode)Create a Type instance for the given type.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanaddTypes(int typeCodeFilter, java.util.HashSet<Type> checked, java.util.Vector<Type> matching)protected static voidclassNotFound(boolean quiet, ContextStack stack, ClassNotFound e)Report a ClassNotFoundException thru the compiler environment.protected static voidclassNotFound(ContextStack stack, ClassNotFound e)Report a ClassNotFoundException thru the compiler environment.protected java.lang.Objectclone()Cloning is supported by returning a shallow copy of this object.Type[]collectMatching(int typeCodeFilter)Collect all the matching types referenced directly or indirectly by this type, including itself.Type[]collectMatching(int typeCodeFilter, java.util.HashSet<Type> alreadyChecked)Collect all the matching types referenced directly or indirectly by this type, including itself.protected intcountTypes()Return count of previously parsed types.protected voiddestroy()Release all resources.booleanequals(java.lang.Object obj)Equality check based on the string representation.protected static booleanfailedConstraint(int constraintNum, boolean quiet, ContextStack stack)Report a constraint failure thru the compiler environment.protected static booleanfailedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0)Report a constraint failure thru the compiler environment.protected static booleanfailedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0, java.lang.Object arg1)Report a constraint failure thru the compiler environment.protected static booleanfailedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)Report a constraint failure thru the compiler environment.java.lang.StringgetArrayBrackets()Get brackets string.intgetArrayDimension()Get array dimension.java.lang.StringgetBoxedRepositoryID()Return the repository ID for this "boxed" type.java.lang.Class<?>getClassInstance()Return the Class for this type.java.lang.StringgetElementName()Return context element name.TypegetElementType()Get element type.BatchEnvironmentgetEnv()Return the compiler environment for this type.intgetFullTypeCode()Get type code, with modifiers.IdentifiergetIdentifier()Return the identifier for this type.java.lang.String[]getIDLModuleNames()IDL_Naming Return the IDL module name for this type (e.g.java.lang.StringgetIDLName()IDL_Naming Return the unqualified IDL name of this type (e.g.java.lang.StringgetName()Return the unqualified name for this type (e.g.java.lang.StringgetPackageName()Return the package of this type (e.g.java.lang.StringgetQualifiedIDLName(boolean global)IDL_Naming Return the fully qualified IDL name for this type (e.g.java.lang.StringgetQualifiedName()Return the fully qualified name of this type (e.g.java.lang.StringgetRepositoryID()Return the repository ID for this type.intgetRootTypeCode()Return the fullTypeCode.abstract java.lang.StringgetSignature()Return signature for this type (e.g.intgetStatus()Return the status of this type.protected static TypegetType(java.lang.String key, ContextStack stack)Get a type out of the table.protected static TypegetType(Type key, ContextStack stack)Get a type out of the table.intgetTypeCode()Get type code, without modifiers.intgetTypeCodeModifiers()Get type code modifiers.abstract java.lang.StringgetTypeDescription()Return a string describing this type.java.lang.StringgetTypeName(boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Return the name of this type.protected TypegetValidType(Type invalidType)Convert an invalid type to a valid one.private booleaninitClass()booleanisArray()Return true if this type is-a ArrayType.booleanisClass()Return true if this type is-a ClassType.booleanisCompound()Return true if this type is-a CompoundType.booleanisConforming()Return true if this type is a conforming type.booleanisInner()Return true if this type is-a inner class or interface.booleanisInterface()Return true if this type is-a InterfaceType.booleanisPrimitive()Return true if this type is-a PrimitiveType.booleanisSpecialClass()Return true if this type is-a SpecialClassType.booleanisSpecialInterface()Return true if this type is-a SpecialInterfaceType.booleanisType(int typeCodeMask)Check for a certain type.protected abstract java.lang.Class<?>loadClass()voidprint(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Print this type.voidprint(IndentingWriter writer, int typeCodeFilter, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Print all types referenced directly or indirectly by this type which match the filter.static voidprint(IndentingWriter writer, Type[] theTypes, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Print an array of types.voidprintln(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Print this type, followed by a newline.protected voidprintPackageClose(IndentingWriter writer, boolean useIDLNames)Print the "closing" of the package or module of this type.protected voidprintPackageOpen(IndentingWriter writer, boolean useIDLNames)Print the "opening" of the package or module of this type.voidprintTypeName(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Print the name of this type.protected static voidputInvalidType(Type key, java.lang.String value, ContextStack stack)Put an invalid type into the.protected static voidputType(java.lang.String key, Type value, ContextStack stack)Put a type into the table.protected static voidputType(Type key, Type value, ContextStack stack)Put a type into the table.voidremoveInvalidTypes()Remove all invalid types...protected static voidremoveType(java.lang.String key, ContextStack stack)Remove a type from the table.protected static voidremoveType(Type key, ContextStack stack)Remove a type from the table.(package private) voidresetTypes()Reset types removes all previously parsed types.protected voidsetIDLNames(java.lang.String[] idlModuleNames, java.lang.String idlName)Set IDL name.protected voidsetNames(Identifier id, java.lang.String[] idlModuleNames, java.lang.String idlName)Set name and package.protected booleansetRepositoryID()voidsetStatus(int status)Set the status of this type.protected voidsetTypeCode(int fullTypeCode)Set type codes.protected voidswapInvalidTypes()Convert all invalid types to valid ones.java.lang.StringtoString()Return a string representation of this type.booleantypeMatches(int typeCodeMask)Like isType(), but returns true if any of the bits in typeCodeMask are present in the full type code of this object.protected static voidupdateAllInvalidTypes(ContextStack stack)Walk all types and tell them to update invalid types...
-
-
-
Field Detail
-
typeCode
private int typeCode
-
fullTypeCode
private int fullTypeCode
-
id
private Identifier id
-
name
private java.lang.String name
-
packageName
private java.lang.String packageName
-
qualifiedName
private java.lang.String qualifiedName
-
idlName
private java.lang.String idlName
-
idlModuleNames
private java.lang.String[] idlModuleNames
-
qualifiedIDLName
private java.lang.String qualifiedIDLName
-
repositoryID
private java.lang.String repositoryID
-
ourClass
private java.lang.Class<?> ourClass
-
status
private int status
-
env
protected BatchEnvironment env
-
stack
protected ContextStack stack
-
destroyed
protected boolean destroyed
-
-
Constructor Detail
-
Type
protected Type(ContextStack stack, int fullTypeCode)
Create a Type instance for the given type. Requires that setName(Identifier) be called afterward.
-
Type
private Type()
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the unqualified name for this type (e.g. com.acme.Dynamite would return "Dynamite").
-
getPackageName
public java.lang.String getPackageName()
Return the package of this type (e.g. com.acme.Dynamite would return "com.acme"). Will return null if default package or if this type is a primitive.
-
getQualifiedName
public java.lang.String getQualifiedName()
Return the fully qualified name of this type (e.g. com.acme.Dynamite would return "com.acme.Dynamite")
-
getSignature
public abstract java.lang.String getSignature()
Return signature for this type (e.g. com.acme.Dynamite would return "com.acme.Dynamite", byte = "B")
-
getIDLName
public java.lang.String getIDLName()
IDL_Naming Return the unqualified IDL name of this type (e.g. com.acme.Dynamite would return "Dynamite").
-
getIDLModuleNames
public java.lang.String[] getIDLModuleNames()
IDL_Naming Return the IDL module name for this type (e.g. com.acme.Dynamite would return a three element array of {"com","acme"). May be a zero length array if there is no module name.
-
getQualifiedIDLName
public java.lang.String getQualifiedIDLName(boolean global)
IDL_Naming Return the fully qualified IDL name for this type (e.g. com.acme.Dynamite would return "com::acme::Dynamite").- Parameters:
global- If true, prepends "::".
-
getIdentifier
public Identifier getIdentifier()
Return the identifier for this type. May be qualified.
-
getRepositoryID
public java.lang.String getRepositoryID()
Return the repository ID for this type.
-
getBoxedRepositoryID
public java.lang.String getBoxedRepositoryID()
Return the repository ID for this "boxed" type.
-
getClassInstance
public java.lang.Class<?> getClassInstance()
Return the Class for this type.
-
getStatus
public int getStatus()
Return the status of this type.
-
setStatus
public void setStatus(int status)
Set the status of this type.
-
getEnv
public BatchEnvironment getEnv()
Return the compiler environment for this type.
-
getTypeCode
public int getTypeCode()
Get type code, without modifiers. Type codes are defined in org.glassfish.rmic.iiop.Constants.
-
getFullTypeCode
public int getFullTypeCode()
Get type code, with modifiers. Type codes are defined in org.glassfish.rmic.iiop.Constants.
-
getTypeCodeModifiers
public int getTypeCodeModifiers()
Get type code modifiers. Type codes are defined in org.glassfish.rmic.iiop.Constants.
-
isType
public boolean isType(int typeCodeMask)
Check for a certain type. Type codes are defined in org.glassfish.rmic.iiop.Constants. Returns true if all of the bits in typeCodeMask are present in the full type code of this object.
-
typeMatches
public boolean typeMatches(int typeCodeMask)
Like isType(), but returns true if any of the bits in typeCodeMask are present in the full type code of this object.
-
getRootTypeCode
public int getRootTypeCode()
Return the fullTypeCode. If an array, returns the type code from the element type.
-
isInterface
public boolean isInterface()
Return true if this type is-a InterfaceType.
-
isClass
public boolean isClass()
Return true if this type is-a ClassType.
-
isInner
public boolean isInner()
Return true if this type is-a inner class or interface.
-
isSpecialInterface
public boolean isSpecialInterface()
Return true if this type is-a SpecialInterfaceType.
-
isSpecialClass
public boolean isSpecialClass()
Return true if this type is-a SpecialClassType.
-
isCompound
public boolean isCompound()
Return true if this type is-a CompoundType.
-
isPrimitive
public boolean isPrimitive()
Return true if this type is-a PrimitiveType.
-
isArray
public boolean isArray()
Return true if this type is-a ArrayType.
-
isConforming
public boolean isConforming()
Return true if this type is a conforming type.
-
toString
public java.lang.String toString()
Return a string representation of this type.- Overrides:
toStringin classjava.lang.Object
-
getElementType
public Type getElementType()
Get element type. Returns null if not an array.
-
getArrayDimension
public int getArrayDimension()
Get array dimension. Returns zero if not an array.
-
getArrayBrackets
public java.lang.String getArrayBrackets()
Get brackets string. Returns "" if not an array.
-
equals
public boolean equals(java.lang.Object obj)
Equality check based on the string representation.- Overrides:
equalsin classjava.lang.Object
-
collectMatching
public Type[] collectMatching(int typeCodeFilter)
Collect all the matching types referenced directly or indirectly by this type, including itself.- Parameters:
typeCodeFilter- The typeCode to use as a filter.
-
collectMatching
public Type[] collectMatching(int typeCodeFilter, java.util.HashSet<Type> alreadyChecked)
Collect all the matching types referenced directly or indirectly by this type, including itself.- Parameters:
typeCodeFilter- The typeCode to use as a filter.alreadyChecked- Contains types which have previously been checked and will be ignored. Updated during collection.
-
getTypeDescription
public abstract java.lang.String getTypeDescription()
Return a string describing this type.
-
getTypeName
public java.lang.String getTypeName(boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames)Return the name of this type. For arrays, will include "[]" if useIDLNames == false.- Parameters:
useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".
-
print
public void print(IndentingWriter writer, int typeCodeFilter, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames) throws java.io.IOException
Print all types referenced directly or indirectly by this type which match the filter.- Parameters:
writer- The stream to print to.typeCodeFilter- The type codes to print.useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".- Throws:
java.io.IOException
-
print
public static void print(IndentingWriter writer, Type[] theTypes, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames) throws java.io.IOException
Print an array of types.- Parameters:
writer- The stream to print to.theTypes- The types to print.useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".- Throws:
java.io.IOException
-
print
public void print(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames) throws java.io.IOException
Print this type.- Parameters:
writer- The stream to print to.useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".- Throws:
java.io.IOException
-
println
public void println(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames) throws java.io.IOException
Print this type, followed by a newline.- Parameters:
writer- The stream to print to.useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".- Throws:
java.io.IOException
-
printTypeName
public void printTypeName(IndentingWriter writer, boolean useQualifiedNames, boolean useIDLNames, boolean globalIDLNames) throws java.io.IOException
Print the name of this type.- Parameters:
writer- The stream to print to.useQualifiedNames- If true, print qualified names; otherwise, print unqualified names.useIDLNames- If true, print IDL names; otherwise, print java names.globalIDLNames- If true and useIDLNames true, prepends "::".- Throws:
java.io.IOException
-
getElementName
public java.lang.String getElementName()
Return context element name.- Specified by:
getElementNamein interfaceContextElement
-
printPackageOpen
protected void printPackageOpen(IndentingWriter writer, boolean useIDLNames) throws java.io.IOException
Print the "opening" of the package or module of this type.- Parameters:
writer- The stream to print to.useIDLNames- If true, print IDL names; otherwise, print java names.- Throws:
java.io.IOException
-
getType
protected static Type getType(Type key, ContextStack stack)
Get a type out of the table.
-
getType
protected static Type getType(java.lang.String key, ContextStack stack)
Get a type out of the table.
-
removeType
protected static void removeType(java.lang.String key, ContextStack stack)Remove a type from the table.
-
removeType
protected static void removeType(Type key, ContextStack stack)
Remove a type from the table.
-
putType
protected static void putType(Type key, Type value, ContextStack stack)
Put a type into the table.
-
putType
protected static void putType(java.lang.String key, Type value, ContextStack stack)Put a type into the table.
-
putInvalidType
protected static void putInvalidType(Type key, java.lang.String value, ContextStack stack)
Put an invalid type into the.
-
removeInvalidTypes
public void removeInvalidTypes()
Remove all invalid types...
-
updateAllInvalidTypes
protected static void updateAllInvalidTypes(ContextStack stack)
Walk all types and tell them to update invalid types...
-
countTypes
protected int countTypes()
Return count of previously parsed types.
-
resetTypes
void resetTypes()
Reset types removes all previously parsed types.
-
destroy
protected void destroy()
Release all resources.
-
swapInvalidTypes
protected void swapInvalidTypes()
Convert all invalid types to valid ones.
-
printPackageClose
protected void printPackageClose(IndentingWriter writer, boolean useIDLNames) throws java.io.IOException
Print the "closing" of the package or module of this type.- Parameters:
writer- The stream to print to.useIDLNames- If true, print IDL names; otherwise, print java names.- Throws:
java.io.IOException
-
setTypeCode
protected void setTypeCode(int fullTypeCode)
Set type codes. May only be called during initialization.
-
setNames
protected void setNames(Identifier id, java.lang.String[] idlModuleNames, java.lang.String idlName)
Set name and package. May only be called during initialization.
-
setIDLNames
protected void setIDLNames(java.lang.String[] idlModuleNames, java.lang.String idlName)Set IDL name. May only be called during initialization.
-
classNotFound
protected static void classNotFound(ContextStack stack, ClassNotFound e)
Report a ClassNotFoundException thru the compiler environment.
-
classNotFound
protected static void classNotFound(boolean quiet, ContextStack stack, ClassNotFound e)Report a ClassNotFoundException thru the compiler environment.
-
failedConstraint
protected static boolean failedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)Report a constraint failure thru the compiler environment.- Parameters:
constraintNum- Used to generate a key of the form "rmic.iiop.constraint.N", which must identify a message in the "rmic.properties" file.quiet- True if should not cause failure or message.stack- The context stack.arg0- An object to substitute for {0} in the message.arg1- An object to substitute for {1} in the message.arg2- An object to substitute for {2} in the message.- Returns:
- false.
-
failedConstraint
protected static boolean failedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0, java.lang.Object arg1)Report a constraint failure thru the compiler environment.- Parameters:
constraintNum- Used to generate a key of the form "rmic.iiop.constraint.N", which must identify a message in the "rmic.properties" file.quiet- True if should not cause failure or message.stack- The context stack.arg0- An object to substitute for {0} in the message.arg1- An object to substitute for {1} in the message.- Returns:
- false.
-
failedConstraint
protected static boolean failedConstraint(int constraintNum, boolean quiet, ContextStack stack, java.lang.Object arg0)Report a constraint failure thru the compiler environment.- Parameters:
constraintNum- Used to generate a key of the form "rmic.iiop.constraint.N", which must identify a message in the "rmic.properties" file.quiet- True if should not cause failure or message.stack- The context stack.arg0- An object to substitute for {0} in the message.- Returns:
- false.
-
failedConstraint
protected static boolean failedConstraint(int constraintNum, boolean quiet, ContextStack stack)Report a constraint failure thru the compiler environment.- Parameters:
quiet- True if should not cause failure or message.stack- The context stack.constraintNum- Used to generate a key of the form "rmic.iiop.constraint.N", which must identify a message in the "rmic.properties" file.- Returns:
- false.
-
clone
protected java.lang.Object clone()
Cloning is supported by returning a shallow copy of this object.- Overrides:
clonein classjava.lang.Object
-
addTypes
protected boolean addTypes(int typeCodeFilter, java.util.HashSet<Type> checked, java.util.Vector<Type> matching)
-
loadClass
protected abstract java.lang.Class<?> loadClass()
-
initClass
private boolean initClass()
-
setRepositoryID
protected boolean setRepositoryID()
-
-