public class UnresolvedType extends java.lang.Object implements Traceable, TypeVariableDeclaringElement
Every UnresolvedType has a signature, the unique key for the type in the world.
Modifier and Type | Class and Description |
---|---|
static class |
UnresolvedType.TypeKind |
Modifier | Constructor and Description |
---|---|
protected |
UnresolvedType(java.lang.String signature) |
protected |
UnresolvedType(java.lang.String signature,
java.lang.String signatureErasure) |
|
UnresolvedType(java.lang.String signature,
java.lang.String signatureErasure,
UnresolvedType[] typeParams) |
Modifier and Type | Method and Description |
---|---|
static UnresolvedType[] |
add(UnresolvedType[] types,
UnresolvedType end)
Creates a new type array with a fresh type appended to the end.
|
boolean |
equals(java.lang.Object other)
Equality is checked based on the underlying signature.
|
static UnresolvedType |
forGenericType(java.lang.String name,
TypeVariable[] tvbs,
java.lang.String genericSig) |
static UnresolvedType |
forGenericTypeSignature(java.lang.String sig,
java.lang.String declaredGenericSig) |
static UnresolvedType |
forGenericTypeVariables(java.lang.String sig,
TypeVariable[] tVars) |
static UnresolvedType |
forName(java.lang.String name)
NOTE: Use forSignature() if you can, it'll be cheaper ! Constructs a UnresolvedType for a java language type name.
|
static UnresolvedType[] |
forNames(java.lang.String[] names)
Constructs a UnresolvedType for each java language type name in an incoming array.
|
static UnresolvedType |
forPrimitiveType(java.lang.String signature) |
static UnresolvedType |
forRawTypeName(java.lang.String name) |
static UnresolvedType |
forSignature(java.lang.String signature)
Constructs a Type for a JVM bytecode signature string.
|
static UnresolvedType[] |
forSignatures(java.lang.String[] sigs)
Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.
|
java.lang.String |
getBaseName() |
java.lang.String |
getClassName() |
UnresolvedType |
getComponentType()
Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an
array type.
|
java.lang.String |
getErasureSignature()
For parameterized types, return the signature for the raw type
|
java.lang.String |
getName()
Returns the name of this type in java language form (e.g.
|
java.lang.String |
getNameAsIdentifier() |
static java.lang.String[] |
getNames(UnresolvedType[] types)
Returns an array of strings representing the java langauge names of an array of types.
|
UnresolvedType |
getOutermostType()
Returns a UnresolvedType object representing the effective outermost enclosing type for a name type.
|
java.lang.String |
getPackageName() |
java.lang.String |
getPackageNameAsIdentifier() |
java.lang.String |
getRawName() |
UnresolvedType |
getRawType() |
java.lang.String |
getSignature()
Returns the name of this type in JVM signature form.
|
java.lang.String |
getSimpleBaseName() |
java.lang.String |
getSimpleName() |
int |
getSize()
This is the size of this type as used in JVM.
|
UnresolvedType.TypeKind |
getTypekind() |
UnresolvedType[] |
getTypeParameters() |
TypeVariable |
getTypeVariableNamed(java.lang.String name) |
TypeVariable[] |
getTypeVariables() |
int |
hashCode()
Equality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its
signature string.
|
static UnresolvedType[] |
insert(UnresolvedType start,
UnresolvedType[] types)
Creates a new type array with a fresh type inserted at the beginning.
|
boolean |
isArray() |
boolean |
isGenericType() |
boolean |
isGenericWildcard() |
boolean |
isParameterizedOrGenericType() |
boolean |
isParameterizedOrRawType() |
boolean |
isParameterizedType() |
boolean |
isPrimitiveType() |
boolean |
isRawType() |
boolean |
isSimpleType() |
boolean |
isTypeVariableReference() |
boolean |
isVoid() |
static UnresolvedType |
makeArray(UnresolvedType base,
int dims) |
boolean |
needsModifiableDelegate() |
UnresolvedType |
parameterize(java.util.Map<java.lang.String,UnresolvedType> typeBindings)
Return a version of this parameterized type in which any type parameters that are type variable references are replaced by
their matching type variable binding.
|
static UnresolvedType |
read(java.io.DataInputStream s)
Read in an UnresolvedType - just read the signature and rebuild the UnresolvedType.
|
static UnresolvedType[] |
readArray(java.io.DataInputStream s) |
ResolvedType |
resolve(World world)
Returns a resolved version of this type according to a particular world.
|
void |
setNeedsModifiableDelegate(boolean b) |
java.lang.String |
toDebugString() |
java.lang.String |
toString()
Returns a java language string representation of this type.
|
java.lang.String |
toTraceString() |
void |
write(CompressingDataOutputStream s)
Write out an UnresolvedType - the signature should be enough.
|
static void |
writeArray(UnresolvedType[] types,
CompressingDataOutputStream stream) |
public static final UnresolvedType[] NONE
public static final UnresolvedType OBJECT
public static final UnresolvedType OBJECTARRAY
public static final UnresolvedType CLONEABLE
public static final UnresolvedType SERIALIZABLE
public static final UnresolvedType THROWABLE
public static final UnresolvedType RUNTIME_EXCEPTION
public static final UnresolvedType ERROR
public static final UnresolvedType AT_INHERITED
public static final UnresolvedType AT_RETENTION
public static final UnresolvedType ENUM
public static final UnresolvedType ANNOTATION
public static final UnresolvedType JL_CLASS
public static final UnresolvedType JAVA_LANG_CLASS_ARRAY
public static final UnresolvedType JL_STRING
public static final UnresolvedType JL_EXCEPTION
public static final UnresolvedType JAVA_LANG_REFLECT_METHOD
public static final UnresolvedType JAVA_LANG_REFLECT_FIELD
public static final UnresolvedType JAVA_LANG_REFLECT_CONSTRUCTOR
public static final UnresolvedType JAVA_LANG_ANNOTATION
public static final UnresolvedType SUPPRESS_AJ_WARNINGS
public static final UnresolvedType AT_TARGET
public static final UnresolvedType SOMETHING
public static final UnresolvedType[] ARRAY_WITH_JUST_OBJECT
public static final UnresolvedType JOINPOINT_STATICPART
public static final UnresolvedType JOINPOINT_ENCLOSINGSTATICPART
public static final UnresolvedType BOOLEAN
public static final UnresolvedType BYTE
public static final UnresolvedType CHAR
public static final UnresolvedType DOUBLE
public static final UnresolvedType FLOAT
public static final UnresolvedType INT
public static final UnresolvedType LONG
public static final UnresolvedType SHORT
public static final UnresolvedType VOID
public static final java.lang.String MISSING_NAME
protected UnresolvedType.TypeKind typeKind
protected java.lang.String signature
protected java.lang.String signatureErasure
protected UnresolvedType[] typeParameters
protected TypeVariable[] typeVariables
protected UnresolvedType(java.lang.String signature)
protected UnresolvedType(java.lang.String signature, java.lang.String signatureErasure)
public UnresolvedType(java.lang.String signature, java.lang.String signatureErasure, UnresolvedType[] typeParams)
public boolean isPrimitiveType()
public boolean isVoid()
public boolean isSimpleType()
public boolean isRawType()
public boolean isGenericType()
public boolean isParameterizedType()
public boolean isParameterizedOrGenericType()
public boolean isParameterizedOrRawType()
public boolean isTypeVariableReference()
public boolean isGenericWildcard()
public UnresolvedType.TypeKind getTypekind()
public final boolean isArray()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getSize()
public static UnresolvedType forName(java.lang.String name)
Types may equivalently be produced by this or byUnresolvedType.forName("java.lang.Thread[]") UnresolvedType.forName("int")
forSignature(String)
.
UnresolvedType.forName("java.lang.Thread[]").equals(Type.forSignature("[Ljava/lang/Thread;") UnresolvedType.forName("int").equals(Type.forSignature("I"))
name
- the java language type name in question.public static UnresolvedType[] forNames(java.lang.String[] names)
names
- an array of java language type names.forName(String)
public static UnresolvedType forGenericType(java.lang.String name, TypeVariable[] tvbs, java.lang.String genericSig)
public static UnresolvedType forGenericTypeSignature(java.lang.String sig, java.lang.String declaredGenericSig)
public static UnresolvedType forGenericTypeVariables(java.lang.String sig, TypeVariable[] tVars)
public static UnresolvedType forRawTypeName(java.lang.String name)
public static UnresolvedType forPrimitiveType(java.lang.String signature)
public static UnresolvedType[] add(UnresolvedType[] types, UnresolvedType end)
types
- the left hand side of the new arrayend
- the right hand side of the new arraypublic static UnresolvedType[] insert(UnresolvedType start, UnresolvedType[] types)
start
- the left hand side of the new arraytypes
- the right hand side of the new arraypublic static UnresolvedType forSignature(java.lang.String signature)
Types may equivalently be produced by this or byUnresolvedType.forSignature("[Ljava/lang/Thread;") UnresolvedType.forSignature("I");
forName(String)
. This method should not be passed P signatures.
UnresolvedType.forName("java.lang.Thread[]").equals(Type.forSignature("[Ljava/lang/Thread;") UnresolvedType.forName("int").equals(Type.forSignature("I"))
signature
- the JVM bytecode signature string for the desired type.public static UnresolvedType[] forSignatures(java.lang.String[] sigs)
names
- an array of JVM bytecode type signaturesforSignature(String)
public java.lang.String getName()
Class.getName()
.public java.lang.String getSimpleName()
public java.lang.String getRawName()
public java.lang.String getBaseName()
public java.lang.String getSimpleBaseName()
public static java.lang.String[] getNames(UnresolvedType[] types)
types
- an array of UnresolvedType objectsgetName()
public java.lang.String getSignature()
and for all String s where s is a lexically valid JVM type signature string:UnresolvedType.forSignature(t.getSignature()).equals(t)
UnresolvedType.forSignature(s).getSignature().equals(s)
public java.lang.String getErasureSignature()
public boolean needsModifiableDelegate()
public void setNeedsModifiableDelegate(boolean b)
public UnresolvedType getRawType()
public UnresolvedType getOutermostType()
public UnresolvedType getComponentType()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDebugString()
public ResolvedType resolve(World world)
world
- the World
within which to resolve.public final void write(CompressingDataOutputStream s) throws java.io.IOException
java.io.IOException
public static UnresolvedType read(java.io.DataInputStream s) throws java.io.IOException
java.io.IOException
public java.lang.String getNameAsIdentifier()
public java.lang.String getPackageNameAsIdentifier()
public UnresolvedType[] getTypeParameters()
public TypeVariable[] getTypeVariables()
public TypeVariable getTypeVariableNamed(java.lang.String name)
getTypeVariableNamed
in interface TypeVariableDeclaringElement
public java.lang.String toTraceString()
toTraceString
in interface Traceable
public UnresolvedType parameterize(java.util.Map<java.lang.String,UnresolvedType> typeBindings)
public java.lang.String getClassName()
public java.lang.String getPackageName()
public static void writeArray(UnresolvedType[] types, CompressingDataOutputStream stream) throws java.io.IOException
java.io.IOException
public static UnresolvedType[] readArray(java.io.DataInputStream s) throws java.io.IOException
java.io.IOException
public static UnresolvedType makeArray(UnresolvedType base, int dims)