public final class TypeReference extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
protected |
TypeReference(ClassLoaderReference cl,
TypeName tn)
NB: All type names should use '/' and not '.' as a separator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
TypeReferences are canonical.
|
static TypeReference |
find(ClassLoaderReference cl,
String typeName) |
static TypeReference |
find(ClassLoaderReference cl,
TypeName typeName)
Find the canonical TypeReference instance for the given pair.
|
static TypeReference |
findOrCreate(ClassLoaderReference cl,
String typeName)
Find or create the canonical
TypeReference instance for the given pair. |
static TypeReference |
findOrCreate(ClassLoaderReference cl,
TypeName typeName)
Find or create the canonical TypeReference instance for the given pair.
|
static TypeReference |
findOrCreateArrayOf(TypeReference t) |
static TypeReference |
findOrCreateClass(ClassLoaderReference loader,
String packageName,
String className) |
static TypeReference |
findOrCreatePointerTo(TypeReference t) |
static TypeReference |
findOrCreateReferenceTo(TypeReference t) |
TypeReference |
getArrayElementType()
TODO: specialized form of TypeReference for arrays, please.
|
TypeReference |
getArrayTypeForElementType()
Get array type corresponding to "this" array element type.
|
ClassLoaderReference |
getClassLoader() |
int |
getDerivedMask()
Return the dimensionality of the type.
|
int |
getDimensionality() |
TypeReference |
getInnermostElementType()
Return the innermost element type reference for an array
|
TypeName |
getName() |
int |
hashCode() |
boolean |
isArrayType()
Does 'this' refer to an array?
|
boolean |
isClassType()
Does 'this' refer to a class?
|
boolean |
isPrimitiveType()
Does 'this' refer to a primitive type
|
static boolean |
isPrimitiveType(TypeName name)
Could name a represent a primitive type?
|
boolean |
isReferenceType()
Does 'this' refer to a reference type
|
static TypeReference |
makePrimitive(ClassLoaderReference cl,
TypeName n) |
String |
toString() |
public static final TypeName BooleanName
public static final byte BooleanTypeCode
public static final TypeReference Boolean
public static final TypeName ByteName
public static final byte ByteTypeCode
public static final TypeReference Byte
public static final TypeName CharName
public static final byte CharTypeCode
public static final TypeReference Char
public static final TypeName DoubleName
public static final byte DoubleTypeCode
public static final TypeReference Double
public static final TypeName FloatName
public static final byte FloatTypeCode
public static final TypeReference Float
public static final TypeName IntName
public static final byte IntTypeCode
public static final TypeReference Int
public static final TypeName LongName
public static final byte LongTypeCode
public static final TypeReference Long
public static final TypeName ShortName
public static final byte ShortTypeCode
public static final TypeReference Short
public static final TypeName VoidName
public static final byte VoidTypeCode
public static final TypeReference Void
public static final byte OtherPrimitiveTypeCode
public static final TypeReference BooleanArray
public static final TypeReference ByteArray
public static final TypeReference CharArray
public static final TypeReference DoubleArray
public static final TypeReference FloatArray
public static final TypeReference IntArray
public static final TypeReference LongArray
public static final TypeReference ShortArray
public static final TypeReference JavaLangArithmeticException
public static final TypeReference JavaLangArrayStoreException
public static final TypeReference JavaLangArrayIndexOutOfBoundsException
public static final TypeReference JavaLangClass
public static final TypeReference JavaLangInvokeMethodHandle
public static final TypeReference JavaLangInvokeMethodType
public static final TypeReference JavaLangClassCastException
public static final TypeReference JavaLangComparable
public static final TypeReference JavaLangReflectConstructor
public static final TypeReference JavaLangReflectMethod
public static final TypeReference JavaLangEnum
public static final TypeReference JavaLangError
public static final TypeReference JavaLangException
public static final TypeReference JavaLangNegativeArraySizeException
public static final TypeReference JavaLangNullPointerException
public static final TypeReference JavaLangRuntimeException
public static final TypeReference JavaLangClassNotFoundException
public static final TypeReference JavaLangOutOfMemoryError
public static final TypeReference JavaLangExceptionInInitializerError
public static final TypeReference JavaLangObject
public static final TypeReference JavaLangStackTraceElement
public static final TypeReference JavaLangString
public static final TypeReference JavaLangStringBuffer
public static final TypeReference JavaLangStringBuilder
public static final TypeReference JavaLangThread
public static final TypeReference JavaLangThrowable
public static final TypeName JavaLangCloneableName
public static final TypeReference JavaLangCloneable
public static final TypeReference JavaLangSystem
public static final TypeReference JavaLangInteger
public static final TypeReference JavaLangBoolean
public static final TypeReference JavaLangDouble
public static final TypeReference JavaLangFloat
public static final TypeReference JavaLangShort
public static final TypeReference JavaLangLong
public static final TypeReference JavaLangByte
public static final TypeReference JavaLangCharacter
public static final TypeName JavaIoSerializableName
public static final TypeReference JavaIoSerializable
public static final TypeReference JavaUtilCollection
public static final TypeReference JavaUtilMap
public static final TypeReference JavaUtilHashSet
public static final TypeReference JavaUtilSet
public static final TypeReference JavaUtilEnum
public static final TypeReference JavaUtilIterator
public static final TypeReference JavaUtilVector
public static final byte ClassTypeCode
public static final byte ArrayTypeCode
public static final byte PointerTypeCode
public static final byte ReferenceTypeCode
public static final TypeReference Null
public static final TypeReference Unknown
public static final TypeReference LambdaMetaFactory
protected TypeReference(ClassLoaderReference cl, TypeName tn)
cl
- the classloadertn
- the type namepublic static TypeReference makePrimitive(ClassLoaderReference cl, TypeName n)
public static boolean isPrimitiveType(TypeName name)
public static TypeReference findOrCreate(ClassLoaderReference cl, TypeName typeName)
cl
- the classloader (defining/initiating depending on usage)public static TypeReference findOrCreate(ClassLoaderReference cl, String typeName)
TypeReference
instance for the given pair.cl
- the classloader (defining/initiating depending on usage)typeName
- something like "Ljava/util/Arrays"public static TypeReference find(ClassLoaderReference cl, String typeName)
public static TypeReference find(ClassLoaderReference cl, TypeName typeName)
cl
- the classloader (defining/initiating depending on usage)public static TypeReference findOrCreateArrayOf(TypeReference t)
public static TypeReference findOrCreateReferenceTo(TypeReference t)
public static TypeReference findOrCreatePointerTo(TypeReference t)
public final ClassLoaderReference getClassLoader()
public final TypeName getName()
public final TypeReference getArrayElementType()
public final TypeReference getArrayTypeForElementType()
public final int getDerivedMask()
public final TypeReference getInnermostElementType()
public final boolean isClassType()
public final boolean isArrayType()
public final boolean isPrimitiveType()
public final boolean isReferenceType()
public final boolean equals(Object other)
public static TypeReference findOrCreateClass(ClassLoaderReference loader, String packageName, String className)
public int getDimensionality()