Class TypeName
java.lang.Object
com.ibm.wala.types.TypeName
- All Implemented Interfaces:
Serializable
We've introduced this class to canonicalize Atoms that represent package names.
NB: All package names should use '/' and not '.' as a separator. eg. Ljava/lang/Class
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static TypeName
findOrCreate
(Atom packageName, Atom className, int dim) static TypeName
static TypeName
findOrCreate
(ImmutableByteArray name, int start, int length) static TypeName
findOrCreate
(String name) static TypeName
findOrCreateClass
(Atom packageName, Atom className) static TypeName
findOrCreateClassName
(String packageName, String className) int
Return the innermost element type reference for an arrayint
hashCode()
boolean
Does 'this' refer to an array?boolean
Does 'this' refer to a class?boolean
Does 'this' refer to a primitive typestatic TypeName
toString()
-
Field Details
-
ArrayMask
public static final byte ArrayMask- See Also:
-
PointerMask
public static final byte PointerMask- See Also:
-
ReferenceMask
public static final byte ReferenceMask- See Also:
-
PrimitiveMask
public static final byte PrimitiveMask- See Also:
-
ElementMask
public static final byte ElementMask- See Also:
-
ElementBits
public static final byte ElementBits- See Also:
-
-
Method Details
-
findOrCreate
public static TypeName findOrCreate(ImmutableByteArray name, int start, int length) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
findOrCreate
- Throws:
IllegalArgumentException
-
findOrCreate
- Throws:
IllegalArgumentException
-
findOrCreateClass
-
findOrCreate
-
equals
-
hashCode
-
toString
-
toUnicodeString
-
string2TypeName
- Parameters:
s
- a String like Ljava/lang/Object- Returns:
- the corresponding TypeName
- Throws:
IllegalArgumentException
- if s is null
-
findOrCreateClassName
-
parseForArrayElementName
- Returns:
- the name of the array element type for an array
-
getArrayTypeForElementType
-
getPointerTypeForElementType
-
getReferenceTypeForElementType
-
getDerivedMask
public int getDerivedMask()- Returns:
- the dimensionality of the type. By convention, class types have dimensionality 0, primitives -1, and arrays the number of [ in their descriptor.
-
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 -
getInnermostElementType
Return the innermost element type reference for an array -
getPackage
- Returns:
- the Atom naming the package for this type.
-
getClassName
- Returns:
- the Atom naming the class for this type (without package)
-