Package com.ibm.wala.types
Class TypeName
- java.lang.Object
-
- com.ibm.wala.types.TypeName
-
- All Implemented Interfaces:
Serializable
public final class TypeName extends Object implements 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static byte
ArrayMask
static byte
ElementBits
static byte
ElementMask
static byte
PointerMask
static byte
PrimitiveMask
static byte
ReferenceMask
-
Method Summary
-
-
-
Field Detail
-
ArrayMask
public static final byte ArrayMask
- See Also:
- Constant Field Values
-
PointerMask
public static final byte PointerMask
- See Also:
- Constant Field Values
-
ReferenceMask
public static final byte ReferenceMask
- See Also:
- Constant Field Values
-
PrimitiveMask
public static final byte PrimitiveMask
- See Also:
- Constant Field Values
-
ElementMask
public static final byte ElementMask
- See Also:
- Constant Field Values
-
ElementBits
public static final byte ElementBits
- See Also:
- Constant Field Values
-
-
Method Detail
-
findOrCreate
public static TypeName findOrCreate(ImmutableByteArray name, int start, int length) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
findOrCreate
public static TypeName findOrCreate(ImmutableByteArray name) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
findOrCreate
public static TypeName findOrCreate(String name) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
toUnicodeString
public String toUnicodeString()
-
string2TypeName
public static TypeName string2TypeName(String s) throws IllegalArgumentException
- Parameters:
s
- a String like Ljava/lang/Object- Returns:
- the corresponding TypeName
- Throws:
IllegalArgumentException
- if s is null
-
findOrCreateClassName
public static TypeName findOrCreateClassName(String packageName, String className)
-
parseForArrayElementName
public TypeName parseForArrayElementName()
- Returns:
- the name of the array element type for an array
-
getArrayTypeForElementType
public TypeName getArrayTypeForElementType()
-
getPointerTypeForElementType
public TypeName getPointerTypeForElementType()
-
getReferenceTypeForElementType
public TypeName getReferenceTypeForElementType()
-
getDerivedMask
public final 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 final boolean isClassType()
Does 'this' refer to a class?
-
isArrayType
public final boolean isArrayType()
Does 'this' refer to an array?
-
isPrimitiveType
public final boolean isPrimitiveType()
Does 'this' refer to a primitive type
-
getInnermostElementType
public final TypeName getInnermostElementType()
Return the innermost element type reference for an array
-
getPackage
public Atom getPackage()
- Returns:
- the Atom naming the package for this type.
-
getClassName
public Atom getClassName()
- Returns:
- the Atom naming the class for this type (without package)
-
-