Class TypeReference
java.lang.Object
com.ibm.wala.types.TypeReference
- All Implemented Interfaces:
Serializable
A class to represent the reference in a class file to some type (class, primitive or array). A
type reference is uniquely defined by
- an initiating class loader
- a type name
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeName
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeName
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final byte
static final byte
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
static final TypeReference
static final TypeReference
static final TypeName
static final byte
-
Method Summary
Modifier and TypeMethodDescriptionboolean
TypeReferences are canonical.static TypeReference
find
(ClassLoaderReference cl, TypeName typeName) Find the canonical TypeReference instance for the given pair.static TypeReference
find
(ClassLoaderReference cl, String typeName) static TypeReference
findOrCreate
(ClassLoaderReference cl, TypeName typeName) Find or create the canonical TypeReference instance for the given pair.static TypeReference
findOrCreate
(ClassLoaderReference cl, String typeName) Find or create the canonicalTypeReference
instance for the given pair.static TypeReference
static TypeReference
findOrCreateClass
(ClassLoaderReference loader, String packageName, String className) static TypeReference
static TypeReference
TODO: specialized form of TypeReference for arrays, please.Get array type corresponding to "this" array element type.int
Return the dimensionality of the type.int
Return the innermost element type reference for an arraygetName()
int
hashCode()
boolean
Does 'this' refer to an array?boolean
Does 'this' refer to a class?boolean
Does 'this' refer to a primitive typestatic boolean
isPrimitiveType
(TypeName name) Could name a represent a primitive type?boolean
Does 'this' refer to a reference typestatic TypeReference
toString()
-
Field Details
-
BooleanName
-
BooleanTypeCode
public static final byte BooleanTypeCode- See Also:
-
Boolean
-
ByteName
-
ByteTypeCode
public static final byte ByteTypeCode- See Also:
-
Byte
-
CharName
-
CharTypeCode
public static final byte CharTypeCode- See Also:
-
Char
-
DoubleName
-
DoubleTypeCode
public static final byte DoubleTypeCode- See Also:
-
Double
-
FloatName
-
FloatTypeCode
public static final byte FloatTypeCode- See Also:
-
Float
-
IntName
-
IntTypeCode
public static final byte IntTypeCode- See Also:
-
Int
-
LongName
-
LongTypeCode
public static final byte LongTypeCode- See Also:
-
Long
-
ShortName
-
ShortTypeCode
public static final byte ShortTypeCode- See Also:
-
Short
-
VoidName
-
VoidTypeCode
public static final byte VoidTypeCode- See Also:
-
Void
-
OtherPrimitiveTypeCode
public static final byte OtherPrimitiveTypeCode- See Also:
-
BooleanArray
-
ByteArray
-
CharArray
-
DoubleArray
-
FloatArray
-
IntArray
-
LongArray
-
ShortArray
-
JavaLangArithmeticException
-
JavaLangArrayStoreException
-
JavaLangArrayIndexOutOfBoundsException
-
JavaLangClass
-
JavaLangInvokeMethodHandle
-
JavaLangInvokeMethodHandlesLookup
-
JavaLangInvokeMethodType
-
JavaLangClassCastException
-
JavaLangComparable
-
JavaLangReflectConstructor
-
JavaLangReflectMethod
-
JavaLangEnum
-
JavaLangError
-
JavaLangException
-
JavaLangNegativeArraySizeException
-
JavaLangNullPointerException
-
JavaLangRuntimeException
-
JavaLangClassNotFoundException
-
JavaLangOutOfMemoryError
-
JavaLangExceptionInInitializerError
-
JavaLangObject
-
JavaLangStackTraceElement
-
JavaLangString
-
JavaLangStringBuffer
-
JavaLangStringBuilder
-
JavaLangThread
-
JavaLangThrowable
-
JavaLangCloneableName
-
JavaLangCloneable
-
JavaLangSystem
-
JavaLangInteger
-
JavaLangBoolean
-
JavaLangDouble
-
JavaLangFloat
-
JavaLangShort
-
JavaLangLong
-
JavaLangByte
-
JavaLangCharacter
-
JavaIoSerializableName
-
JavaIoSerializable
-
JavaUtilCollection
-
JavaUtilMap
-
JavaUtilHashSet
-
JavaUtilSet
-
JavaUtilEnum
-
JavaUtilIterator
-
JavaUtilVector
-
ClassTypeCode
public static final byte ClassTypeCode- See Also:
-
ArrayTypeCode
public static final byte ArrayTypeCode- See Also:
-
PointerTypeCode
public static final byte PointerTypeCode- See Also:
-
ReferenceTypeCode
public static final byte ReferenceTypeCode- See Also:
-
Null
-
Unknown
-
LambdaMetaFactory
-
-
Method Details
-
makePrimitive
-
isPrimitiveType
Could name a represent a primitive type? -
findOrCreate
Find or create the canonical TypeReference instance for the given pair.- Parameters:
cl
- the classloader (defining/initiating depending on usage)
-
findOrCreate
Find or create the canonicalTypeReference
instance for the given pair.- Parameters:
cl
- the classloader (defining/initiating depending on usage)typeName
- something like "Ljava/util/Arrays"
-
find
-
find
Find the canonical TypeReference instance for the given pair. May return null.- Parameters:
cl
- the classloader (defining/initiating depending on usage)
-
findOrCreateArrayOf
-
findOrCreateReferenceTo
-
findOrCreatePointerTo
-
getClassLoader
- Returns:
- the classloader component of this type reference
-
getName
- Returns:
- the type name component of this type reference
-
getArrayElementType
TODO: specialized form of TypeReference for arrays, please. Get the element type of for this array type. -
getArrayTypeForElementType
Get array type corresponding to "this" array element type. -
getDerivedMask
public int getDerivedMask()Return the dimensionality of the type. By convention, class types have dimensionality 0, primitives -1, and arrays the number of [ in their descriptor. -
getInnermostElementType
Return the innermost element type reference for an array -
isClassType
public boolean isClassType()Does 'this' refer to a class? -
isArrayType
public boolean isArrayType()Does 'this' refer to an array? -
isPrimitiveType
public boolean isPrimitiveType()Does 'this' refer to a primitive type -
isReferenceType
public boolean isReferenceType()Does 'this' refer to a reference type -
hashCode
-
equals
TypeReferences are canonical. However, note that two TypeReferences can be non-equal, yet still represent the same IClass.For example, the there can be two TypeReferences <Application,java.lang.Object> and <Primordial,java.lang.Object>. These two TypeReference are NOT equal(), but they both represent the IClass which is named <Primordial,java.lang.Object>
-
toString
-
findOrCreateClass
public static TypeReference findOrCreateClass(ClassLoaderReference loader, String packageName, String className) -
getDimensionality
public int getDimensionality()
-