public abstract class TypeDesc extends Descriptor implements Serializable
Modifier and Type | Field and Description |
---|---|
static TypeDesc |
BOOLEAN
Primitive type boolean
|
static int |
BOOLEAN_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
BYTE
Primitive type byte
|
static int |
BYTE_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
CHAR
Primitive type char
|
static int |
CHAR_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
DOUBLE
Primitive type double
|
static int |
DOUBLE_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
FLOAT
Primitive type float
|
static int |
FLOAT_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
INT
Primitive type int
|
static int |
INT_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
LONG
Primitive type long
|
static int |
LONG_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
OBJECT
Object type java.lang.Object, provided for convenience
|
static int |
OBJECT_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
SHORT
Primitive type short
|
static int |
SHORT_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
static TypeDesc |
STRING
Object type java.lang.String, provided for convenience
|
static TypeDesc |
VOID
Primitive type void
|
static int |
VOID_CODE
Type code returned from getTypeCode, which can be used with the
newarray instruction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static TypeDesc |
forClass(Class clazz)
Acquire a TypeDesc from any class, including primitives and arrays.
|
static TypeDesc |
forClass(String name)
Acquire a TypeDesc from any class name, including primitives and arrays.
|
static TypeDesc |
forDescriptor(String desc)
Acquire a TypeDesc from a type descriptor.
|
abstract TypeDesc |
getComponentType()
Returns the component type of this array type.
|
String |
getDescriptor()
Returns a type descriptor string, excluding generics.
|
abstract int |
getDimensions()
Returns the number of dimensions this array type has.
|
abstract String |
getFullName()
Returns the class name for this descriptor.
|
abstract TypeDesc |
getRootComponentType()
Returns the root component type of this array type.
|
abstract String |
getRootName()
Returns the class name for this descriptor.
|
abstract int |
getTypeCode()
Returns a type code for operating on primitive types in switches.
|
int |
hashCode() |
abstract boolean |
isArray()
Returns true if this is an array type.
|
abstract boolean |
isDoubleWord()
Returns true if this is a primitive long or double type.
|
abstract boolean |
isPrimitive()
Returns true if this is a primitive type.
|
abstract TypeDesc |
toArrayType()
Convertes this type to an array type.
|
abstract Class |
toClass()
Returns this type as a class.
|
abstract Class |
toClass(ClassLoader loader)
Returns this type as a class.
|
abstract TypeDesc |
toObjectType()
Returns the object peer of this primitive type.
|
abstract TypeDesc |
toPrimitiveType()
Returns the primitive peer of this object type, if one exists.
|
String |
toString() |
parse
public static final int OBJECT_CODE
public static final int VOID_CODE
public static final int BOOLEAN_CODE
public static final int CHAR_CODE
public static final int FLOAT_CODE
public static final int DOUBLE_CODE
public static final int BYTE_CODE
public static final int SHORT_CODE
public static final int INT_CODE
public static final int LONG_CODE
public static final TypeDesc VOID
public static final TypeDesc BOOLEAN
public static final TypeDesc CHAR
public static final TypeDesc BYTE
public static final TypeDesc SHORT
public static final TypeDesc INT
public static final TypeDesc LONG
public static final TypeDesc FLOAT
public static final TypeDesc DOUBLE
public static final TypeDesc OBJECT
public static final TypeDesc STRING
public static TypeDesc forClass(Class clazz)
public static TypeDesc forClass(String name) throws IllegalArgumentException
IllegalArgumentException
public static TypeDesc forDescriptor(String desc) throws IllegalArgumentException
IllegalArgumentException
public final String getDescriptor()
getDescriptor
in class Descriptor
public abstract String getRootName()
public abstract String getFullName()
public abstract int getTypeCode()
public abstract boolean isPrimitive()
public abstract boolean isDoubleWord()
public abstract boolean isArray()
public abstract int getDimensions()
public abstract TypeDesc getComponentType()
public abstract TypeDesc getRootComponentType()
public abstract TypeDesc toArrayType()
public abstract TypeDesc toObjectType()
public abstract TypeDesc toPrimitiveType()
public abstract Class toClass()
public abstract Class toClass(ClassLoader loader)
loader
- optional ClassLoader to load class fromCopyright © 2004-2015 Cojen. All Rights Reserved.