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
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeNamestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final bytestatic final bytestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final bytestatic final TypeReferencestatic final TypeReferencestatic final TypeNamestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionbooleanTypeReferences are canonical.static TypeReferencefind(ClassLoaderReference cl, TypeName typeName) Find the canonical TypeReference instance for the given pair.static TypeReferencefind(ClassLoaderReference cl, String typeName) static TypeReferencefindOrCreate(ClassLoaderReference cl, TypeName typeName) Find or create the canonical TypeReference instance for the given pair.static TypeReferencefindOrCreate(ClassLoaderReference cl, String typeName) Find or create the canonicalTypeReferenceinstance for the given pair.static TypeReferencestatic TypeReferencefindOrCreateClass(ClassLoaderReference loader, String packageName, String className) static TypeReferencestatic TypeReferenceTODO: specialized form of TypeReference for arrays, please.Get array type corresponding to "this" array element type.intReturn the dimensionality of the type.intReturn the innermost element type reference for an arraygetName()inthashCode()booleanDoes 'this' refer to an array?booleanDoes 'this' refer to a class?booleanDoes 'this' refer to a primitive typestatic booleanisPrimitiveType(TypeName name) Could name a represent a primitive type?booleanDoes 'this' refer to a reference typestatic TypeReferencetoString()
-
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 canonicalTypeReferenceinstance 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()
-