equals(Object) to
compare type instances.
In most cases, applications which consume this API, only need to call getCtClass()
to obtain the needed type information.
| Modifier and Type | Field and Description |
|---|---|
| public static final Type | BOGUS
Represents a non-accessible value. |
| public static final Type | BOOLEAN
Represents the boolean primitive type |
| public static final Type | BYTE
Represents the byte primitive type |
| public static final Type | CHAR
Represents the char primitive type |
| private final CtClass | |
| public static final Type | CLONEABLE
Represents the java.lang.Coneable reference type |
| public static final Type | DOUBLE
Represents the double primitive type |
| public static final Type | FLOAT
Represents the float primitive type |
| public static final Type | INTEGER
Represents the integer primitive type |
| public static final Type | LONG
Represents the long primitive type |
| public static final Type | OBJECT
Represents the java.lang.Object reference type |
| private static final Map | |
| public static final Type | RETURN_ADDRESS
Represents an internal JVM return address, which is used by the RET instruction to return to a JSR that invoked the subroutine. |
| public static final Type | SERIALIZABLE
Represents the java.io.Serializable reference type |
| public static final Type | SHORT
Represents the short primitive type |
| private final boolean | |
| public static final Type | THROWABLE
Represents the java.lang.Throwable reference type |
| public static final Type | TOP
A placeholder used by the analyzer for the second word position of a double-word type |
| public static final Type | UNINIT
Represents an unknown, or null type. |
| public static final Type | VOID
Represents the void primitive type |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv String | |
| private Type | |
| pack-priv static boolean | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| private Map | |
| pack-priv Map | |
| private static CtClass | |
| private Map | |
| public static Type | |
| pack-priv Map | |
| private ClassPool | |
| public Type | Returns: the array component if an array, otherwise nullReturns the array component if this type is an array. |
| public CtClass | Returns: the class for this type, or null if specialReturns the class this type represents. |
| pack-priv Map | |
| public int | Returns: zero if not an array, otherwise the number of array dimensions.Returns the number of dimensions of this array. |
| pack-priv Type | |
| public int | |
| public int | |
| public boolean | |
| public boolean | Returns: true if this is assignable to type, otherwise falsethe type to test assignability to type)Determines whether this type is assignable, to the passed type. |
| public boolean | Returns: true if a java reference, false if a primitive or specialReturns whether or not this type is a normal java reference, i.e. it is or extends java.lang.Object. |
| public boolean | |
| private static Type | |
| public Type | |
| private Type | |
| private Type | |
| pack-priv boolean | |
| public String |
| BOGUS | back to summary |
|---|---|
| public static final Type BOGUS Represents a non-accessible value. Code cannot access the value this type represents. It occurs when bytecode reuses a local variable table position with non-mergable types. An example would be compiled code which uses the same position for a primitive type in one branch, and a reference type in another branch. | |
| BOOLEAN | back to summary |
|---|---|
| public static final Type BOOLEAN Represents the boolean primitive type | |
| BYTE | back to summary |
|---|---|
| public static final Type BYTE Represents the byte primitive type | |
| CHAR | back to summary |
|---|---|
| public static final Type CHAR Represents the char primitive type | |
| clazz | back to summary |
|---|---|
| private final CtClass clazz | |
| CLONEABLE | back to summary |
|---|---|
| public static final Type CLONEABLE Represents the java.lang.Coneable reference type | |
| DOUBLE | back to summary |
|---|---|
| public static final Type DOUBLE Represents the double primitive type | |
| FLOAT | back to summary |
|---|---|
| public static final Type FLOAT Represents the float primitive type | |
| INTEGER | back to summary |
|---|---|
| public static final Type INTEGER Represents the integer primitive type | |
| LONG | back to summary |
|---|---|
| public static final Type LONG Represents the long primitive type | |
| OBJECT | back to summary |
|---|---|
| public static final Type OBJECT Represents the java.lang.Object reference type | |
| prims | back to summary |
|---|---|
| private static final Map<CtClass, Type> prims | |
| RETURN_ADDRESS | back to summary |
|---|---|
| public static final Type RETURN_ADDRESS Represents an internal JVM return address, which is used by the RET instruction to return to a JSR that invoked the subroutine. | |
| SERIALIZABLE | back to summary |
|---|---|
| public static final Type SERIALIZABLE Represents the java.io.Serializable reference type | |
| SHORT | back to summary |
|---|---|
| public static final Type SHORT Represents the short primitive type | |
| special | back to summary |
|---|---|
| private final boolean special | |
| THROWABLE | back to summary |
|---|---|
| public static final Type THROWABLE Represents the java.lang.Throwable reference type | |
| TOP | back to summary |
|---|---|
| public static final Type TOP A placeholder used by the analyzer for the second word position of a double-word type | |
| UNINIT | back to summary |
|---|---|
| public static final Type UNINIT Represents an unknown, or null type. This occurs when aconst_null is used. It is important not to treat this type as java.lang.Object, since a null can be assigned to any reference type. The analyzer will replace these with an actual known type if it can be determined by a merged path with known type information. If this type is encountered on a frame then it is guaranteed to be null, and the type information is simply not available. Any attempts to infer the type, without further information from the compiler would be a guess. | |
| VOID | back to summary |
|---|---|
| public static final Type VOID Represents the void primitive type | |
| Type | back to summary |
|---|---|
| pack-priv Type(CtClass clazz) | |
| Type | back to summary |
|---|---|
| private Type(CtClass clazz, boolean special) | |
| arrayName | back to summary |
|---|---|
| pack-priv String arrayName(String component, int dims) | |
| createArray | back to summary |
|---|---|
| private Type createArray(Type rootComponent, int dims) | |
| eq | back to summary |
|---|---|
| pack-priv static boolean eq(CtClass one, CtClass two) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| findCommonInterfaces | back to summary |
|---|---|
| private Map | |
| findCommonInterfaces | back to summary |
|---|---|
| pack-priv Map | |
| findCommonSuperClass | back to summary |
|---|---|
| private static CtClass findCommonSuperClass(CtClass one, CtClass two) throws NotFoundException | |
| findExclusiveDeclaredInterfaces | back to summary |
|---|---|
| private Map | |
| get | back to summary |
|---|---|
| public static Type get(CtClass clazz) Obtain the Type for a given class. If the class is a primitive, the the unique type instance for the primitive will be returned. Otherwise a new Type instance representing the class is returned. | |
| getAllInterfaces | back to summary |
|---|---|
| pack-priv Map | |
| getClassPool | back to summary |
|---|---|
| private ClassPool getClassPool(Type rootComponent) | |
| getComponent | back to summary |
|---|---|
| public Type getComponent() Returns the array component if this type is an array. If the type is not an array null is returned.
| |
| getCtClass | back to summary |
|---|---|
| public CtClass getCtClass() Returns the class this type represents. If the type is special, null will be returned.
| |
| getDeclaredInterfaces | back to summary |
|---|---|
| pack-priv Map | |
| getDimensions | back to summary |
|---|---|
| public int getDimensions() Returns the number of dimensions of this array. If the type is not an array zero is returned.
| |
| getRootComponent | back to summary |
|---|---|
| pack-priv Type getRootComponent(Type type) | |
| getSize | back to summary |
|---|---|
| public int getSize() Gets the word size of this type. Double-word types, such as long and double will occupy two positions on the local variable table or stack.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isArray | back to summary |
|---|---|
| public boolean isArray() Returns whether or not this type is an array.
| |
| isAssignableFrom | back to summary |
|---|---|
| public boolean isAssignableFrom(Type type) Determines whether this type is assignable, to the passed type. A type is assignable to another if it is either the same type, or a sub-type.
| |
| isReference | back to summary |
|---|---|
| public boolean isReference() Returns whether or not this type is a normal java reference, i.e. it is or extends java.lang.Object.
| |
| isSpecial | back to summary |
|---|---|
| public boolean isSpecial() Returns whether or not the type is special. A special type is one that is either used for internal tracking, or is only used internally by the JVM.
| |
| lookupType | back to summary |
|---|---|
| private static Type lookupType(String name) | |
| merge | back to summary |
|---|---|
| public Type merge(Type type) Finds the common base type, or interface which both this and the specified
type can be assigned. If there is more than one possible answer, then a | |
| mergeArray | back to summary |
|---|---|
| private Type mergeArray(Type type) | |
| mergeClasses | back to summary |
|---|---|
| private Type mergeClasses(Type type) throws NotFoundException | |
| popChanged | back to summary |
|---|---|
| pack-priv boolean popChanged() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |