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
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeNamefindOrCreate(Atom packageName, Atom className, int dim) static TypeNamestatic TypeNamefindOrCreate(ImmutableByteArray name, int start, int length) static TypeNamefindOrCreate(String name) static TypeNamefindOrCreateClass(Atom packageName, Atom className) static TypeNamefindOrCreateClassName(String packageName, String className) intReturn the innermost element type reference for an arrayinthashCode()booleanDoes 'this' refer to an array?booleanDoes 'this' refer to a class?booleanDoes 'this' refer to a primitive typestatic TypeNametoString()
-
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
-
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)
-