public class Type
extends java.lang.Object
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 |
---|---|
static Type |
BOGUS
Represents a non-accessible value.
|
static Type |
BOOLEAN
Represents the boolean primitive type
|
static Type |
BYTE
Represents the byte primitive type
|
static Type |
CHAR
Represents the char primitive type
|
static Type |
CLONEABLE
Represents the java.lang.Coneable reference type
|
static Type |
DOUBLE
Represents the double primitive type
|
static Type |
FLOAT
Represents the float primitive type
|
static Type |
INTEGER
Represents the integer primitive type
|
static Type |
LONG
Represents the long primitive type
|
static Type |
OBJECT
Represents the java.lang.Object reference type
|
static 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.
|
static Type |
SERIALIZABLE
Represents the java.io.Serializable reference type
|
static Type |
SHORT
Represents the short primitive type
|
static Type |
THROWABLE
Represents the java.lang.Throwable reference type
|
static Type |
TOP
A placeholder used by the analyzer for the second word position of a double-word type
|
static Type |
UNINIT
Represents an unknown, or null type.
|
static Type |
VOID
Represents the void primitive type
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static Type |
get(CtClass clazz)
Obtain the Type for a given class.
|
Type |
getComponent()
Returns the array component if this type is an array.
|
CtClass |
getCtClass()
Returns the class this type represents.
|
int |
getDimensions()
Returns the number of dimensions of this array.
|
int |
getSize()
Gets the word size of this type.
|
boolean |
isArray()
Returns whether or not this type is an array.
|
boolean |
isAssignableFrom(Type type)
Determines whether this type is assignable, to the passed type.
|
boolean |
isReference()
Returns whether or not this type is a normal java reference, i.e.
|
boolean |
isSpecial()
Returns whether or not the type is special.
|
Type |
merge(Type type)
Finds the common base type, or interface which both this and the specified
type can be assigned.
|
java.lang.String |
toString() |
public static final Type DOUBLE
public static final Type BOOLEAN
public static final Type LONG
public static final Type CHAR
public static final Type BYTE
public static final Type SHORT
public static final Type INTEGER
public static final Type FLOAT
public static final Type VOID
public static final Type UNINIT
public static final Type RETURN_ADDRESS
public static final Type TOP
public static final Type BOGUS
public static final Type OBJECT
public static final Type SERIALIZABLE
public static final Type CLONEABLE
public static final Type THROWABLE
public static Type get(CtClass clazz)
clazz
- The java classpublic int getSize()
public CtClass getCtClass()
public boolean isReference()
public boolean isSpecial()
public boolean isArray()
public int getDimensions()
public Type getComponent()
public boolean isAssignableFrom(Type type)
type
- the type to test assignability topublic Type merge(Type type)
MultiType
,
or a MultiArrayType
is returned. Multi-types have special rules,
and successive merges and assignment tests on them will alter their internal state,
as well as other multi-types they have been merged with. This method is used by
the data-flow analyzer to merge the type state from multiple branches.type
- the type to merge withpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.