Top Description Inners Fields Constructors Methods
org.aspectj.weaver

public Class UnresolvedType

extends Object
implements Traceable, TypeVariableDeclaringElement
Class Inheritance
All Implemented Interfaces
org.aspectj.weaver.TypeVariableDeclaringElement, org.aspectj.weaver.tools.Traceable
Known Direct Subclasses
org.aspectj.weaver.UnresolvedTypeVariableReferenceType, org.aspectj.weaver.WildcardedUnresolvedType, org.aspectj.weaver.ResolvedType
Imports
java.io.DataInputStream, .IOException, java.util.Map, org.aspectj.util.GenericSignature, .GenericSignature.ClassSignature, .GenericSignatureParser, org.aspectj.weaver.tools.Traceable

A UnresolvedType represents a type to the weaver. UnresolvedTypes are resolved in some World (a type repository). When a UnresolvedType is resolved it turns into a ResolvedType which may be a primitive type, or a ReferenceType. ReferenceTypes may refer to simple, generic, parameterized or type-variable based reference types. A ReferenceType is backed by a delegate that provides information about the type based on some repository (for example an Eclipse based delegate, a bytecode based delegate or a reflection based delegate).

Every UnresolvedType has a signature, the unique key for the type in the world.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType[]
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
private String
className

Calculated on first request - the class name (String for type java.lang.String)

public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final String
private boolean
public static final UnresolvedType[]
public static final UnresolvedType
public static final UnresolvedType
private String
packageName

Calculated on first request - the package name (java.lang for type java.lang.String)

public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
protected String
protected String
signatureErasure

The erasure of the signature.

private int
public static final UnresolvedType
public static final UnresolvedType
public static final UnresolvedType
protected UnresolvedType.TypeKind
protected UnresolvedType[]
typeParameters

Iff isParameterized(), then these are the type parameters

protected TypeVariable[]
typeVariables

Iff isGeneric(), then these are the type variables declared on the type Iff isParameterized(), then these are the type variables bound as parameters in the type

public static final UnresolvedType

Constructor Summary

AccessConstructor and Description
protected
protected
UnresolvedType(String signature, String signatureErasure)

public
UnresolvedType(String signature, String signatureErasure, UnresolvedType[] typeParams)

Method Summary

Modifier and TypeMethod and Description
public static UnresolvedType[]
add(UnresolvedType[]
the left hand side of the new array
types
,
UnresolvedType
the right hand side of the new array
end
)

Creates a new type array with a fresh type appended to the end.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Equality is checked based on the underlying signature.
public static UnresolvedType
forGenericType(String name, TypeVariable[] tvbs, String genericSig)

public static UnresolvedType
forGenericTypeSignature(String sig, String declaredGenericSig)

public static UnresolvedType
public static UnresolvedType

Returns:

a type object representing that java language type.
forName
(String
the java language type name in question.
name
)

Note

Use forSignature() if you can, it'll be cheaper !

public static UnresolvedType[]

Returns:

an array of UnresolvedType objects.
forNames
(String[]
an array of java language type names.
names
)

Constructs a UnresolvedType for each java language type name in an incoming array.

public static UnresolvedType
public static UnresolvedType
public static UnresolvedType

Returns:

a type object represnting that JVM bytecode signature.
forSignature
(String
the JVM bytecode signature string for the desired type.
signature
)

Constructs a Type for a JVM bytecode signature string.

public static UnresolvedType[]

Returns:

an array of UnresolvedType objects.
forSignatures
(String[]
an array of JVM bytecode type signatures
sigs
)

Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.

public String
public String

Returns:

the class name (does not include the package name)
getClassName
()

public UnresolvedType

Returns:

the component UnresolvedType object, or null.
getComponentType
()

Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an array type.

public final int
public String
getErasureSignature()

For parameterized types, return the signature for the raw type

public String

Returns:

the java language name of this type.
getName
()

Returns the name of this type in java language form (e.g. java.lang.Thread or boolean[]).

public String
public static String[]

Returns:

an array of Strings fo the java language names of types.
getNames
(UnresolvedType[]
an array of UnresolvedType objects
types
)

Returns an array of strings representing the java langauge names of an array of types.

public UnresolvedType

Returns:

the outermost enclosing UnresolvedType object or this.
getOutermostType
()

Returns a UnresolvedType object representing the effective outermost enclosing type for a name type.

public String

Returns:

the package name (no class name included)
getPackageName
()

public String
public String
public UnresolvedType
public String

Returns:

the java JVM signature string for this type.
getSignature
()

Returns the name of this type in JVM signature form.

public String
public String
public int
getSize()

This is the size of this type as used in JVM.

public UnresolvedType.TypeKind
public UnresolvedType[]
public TypeVariable
public TypeVariable[]
public int
hashCode()

Overrides java.lang.Object.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.
public static UnresolvedType[]
insert(UnresolvedType
the left hand side of the new array
start
,
UnresolvedType[]
the right hand side of the new array
types
)

Creates a new type array with a fresh type inserted at the beginning.

public final boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public static UnresolvedType
makeArray(UnresolvedType base, int dims)

private static String
public boolean
public UnresolvedType
parameterize(Map<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.

public static UnresolvedType
read(DataInputStream s)

Read in an UnresolvedType - just read the signature and rebuild the UnresolvedType.

public static UnresolvedType[]
public ResolvedType

Returns:

a resolved type representing this type in the appropriate world.
resolve
(World
the World within which to resolve.
world
)

Returns a resolved version of this type according to a particular world.

public void
private static String
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a java language string representation of this type.
public String
public final void
write(CompressingDataOutputStream s)

Write out an UnresolvedType - the signature should be enough.

public static void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

AJC_PRIVILEGEDback to summary
public static final UnresolvedType AJC_PRIVILEGED
ANNOTATIONback to summary
public static final UnresolvedType ANNOTATION
ARRAY_WITH_JUST_OBJECTback to summary
public static final UnresolvedType[] ARRAY_WITH_JUST_OBJECT
AT_INHERITEDback to summary
public static final UnresolvedType AT_INHERITED
AT_RETENTIONback to summary
public static final UnresolvedType AT_RETENTION
AT_TARGETback to summary
public static final UnresolvedType AT_TARGET
BOOLEANback to summary
public static final UnresolvedType BOOLEAN
BYTEback to summary
public static final UnresolvedType BYTE
CHARback to summary
public static final UnresolvedType CHAR
classNameback to summary
private String className

Calculated on first request - the class name (String for type java.lang.String)

CLONEABLEback to summary
public static final UnresolvedType CLONEABLE
DOUBLEback to summary
public static final UnresolvedType DOUBLE
ENUMback to summary
public static final UnresolvedType ENUM
ERRORback to summary
public static final UnresolvedType ERROR
FLOATback to summary
public static final UnresolvedType FLOAT
INTback to summary
public static final UnresolvedType INT
JAVA_LANG_ANNOTATIONback to summary
public static final UnresolvedType JAVA_LANG_ANNOTATION
JAVA_LANG_CLASS_ARRAYback to summary
public static final UnresolvedType JAVA_LANG_CLASS_ARRAY
JAVA_LANG_REFLECT_CONSTRUCTORback to summary
public static final UnresolvedType JAVA_LANG_REFLECT_CONSTRUCTOR
JAVA_LANG_REFLECT_FIELDback to summary
public static final UnresolvedType JAVA_LANG_REFLECT_FIELD
JAVA_LANG_REFLECT_METHODback to summary
public static final UnresolvedType JAVA_LANG_REFLECT_METHOD
JL_CLASSback to summary
public static final UnresolvedType JL_CLASS
JL_EXCEPTIONback to summary
public static final UnresolvedType JL_EXCEPTION
JL_STRINGback to summary
public static final UnresolvedType JL_STRING
JOINPOINT_ENCLOSINGSTATICPARTback to summary
public static final UnresolvedType JOINPOINT_ENCLOSINGSTATICPART
JOINPOINT_STATICPARTback to summary
public static final UnresolvedType JOINPOINT_STATICPART
LONGback to summary
public static final UnresolvedType LONG
MISSING_NAMEback to summary
public static final String MISSING_NAME
needsModifiableDelegateback to summary
private boolean needsModifiableDelegate
NONEback to summary
public static final UnresolvedType[] NONE
OBJECTback to summary
public static final UnresolvedType OBJECT
OBJECTARRAYback to summary
public static final UnresolvedType OBJECTARRAY
packageNameback to summary
private String packageName

Calculated on first request - the package name (java.lang for type java.lang.String)

PROCEEDING_JOINPOINTback to summary
public static final UnresolvedType PROCEEDING_JOINPOINT
RUNTIME_EXCEPTIONback to summary
public static final UnresolvedType RUNTIME_EXCEPTION
SERIALIZABLEback to summary
public static final UnresolvedType SERIALIZABLE
SHORTback to summary
public static final UnresolvedType SHORT
signatureback to summary
protected String signature
signatureErasureback to summary
protected String signatureErasure

The erasure of the signature. Contains only the Java signature of the type with all supertype, superinterface, type variable, and parameter information removed.

sizeback to summary
private int size
SOMETHINGback to summary
public static final UnresolvedType SOMETHING
SUPPRESS_AJ_WARNINGSback to summary
public static final UnresolvedType SUPPRESS_AJ_WARNINGS
THROWABLEback to summary
public static final UnresolvedType THROWABLE
typeKindback to summary
protected UnresolvedType.TypeKind typeKind
typeParametersback to summary
protected UnresolvedType[] typeParameters

Iff isParameterized(), then these are the type parameters

typeVariablesback to summary
protected TypeVariable[] typeVariables

Iff isGeneric(), then these are the type variables declared on the type Iff isParameterized(), then these are the type variables bound as parameters in the type

VOIDback to summary
public static final UnresolvedType VOID

Constructor Detail

UnresolvedTypeback to summary
protected UnresolvedType(String signature)
UnresolvedTypeback to summary
protected UnresolvedType(String signature, String signatureErasure)
UnresolvedTypeback to summary
public UnresolvedType(String signature, String signatureErasure, UnresolvedType[] typeParams)

Method Detail

addback to summary
public static UnresolvedType[] add(UnresolvedType[] types, UnresolvedType end)

Creates a new type array with a fresh type appended to the end.

Parameters
types:UnresolvedType[]

the left hand side of the new array

end:UnresolvedType

the right hand side of the new array

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Equality is checked based on the underlying signature.

Parameters
other:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
forGenericTypeback to summary
public static UnresolvedType forGenericType(String name, TypeVariable[] tvbs, String genericSig)
forGenericTypeSignatureback to summary
public static UnresolvedType forGenericTypeSignature(String sig, String declaredGenericSig)
forGenericTypeVariablesback to summary
public static UnresolvedType forGenericTypeVariables(String sig, TypeVariable[] tVars)
forNameback to summary
public static UnresolvedType forName(String name)

Note

Use forSignature() if you can, it'll be cheaper ! Constructs a UnresolvedType for a java language type name. For example:

  UnresolvedType.forName("java.lang.Thread[]")
  UnresolvedType.forName("int")
Types may equivalently be produced by this or by forSignature(String).
  UnresolvedType.forName("java.lang.Thread[]").equals(Type.forSignature("[Ljava/lang/Thread;")
  UnresolvedType.forName("int").equals(Type.forSignature("I"))
Parameters
name:String

the java language type name in question.

Returns:UnresolvedType

a type object representing that java language type.

forNamesback to summary
public static UnresolvedType[] forNames(String[] names)

Constructs a UnresolvedType for each java language type name in an incoming array.

Parameters
names:String[]

an array of java language type names.

Returns:UnresolvedType[]

an array of UnresolvedType objects.

See Also
forName(String)
forPrimitiveTypeback to summary
public static UnresolvedType forPrimitiveType(String signature)
forRawTypeNameback to summary
public static UnresolvedType forRawTypeName(String name)
forSignatureback to summary
public static UnresolvedType forSignature(String signature)

Constructs a Type for a JVM bytecode signature string. For example:

  UnresolvedType.forSignature("[Ljava/lang/Thread;")
  UnresolvedType.forSignature("I");
Types may equivalently be produced by this or by 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"))
Parameters
signature:String

the JVM bytecode signature string for the desired type.

Returns:UnresolvedType

a type object represnting that JVM bytecode signature.

forSignaturesback to summary
public static UnresolvedType[] forSignatures(String[] sigs)

Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.

Parameters
sigs:String[]

an array of JVM bytecode type signatures

Returns:UnresolvedType[]

an array of UnresolvedType objects.

See Also
forSignature(String)
getBaseNameback to summary
public String getBaseName()
getClassNameback to summary
public String getClassName()
Returns:String

the class name (does not include the package name)

getComponentTypeback to summary
public UnresolvedType getComponentType()

Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an array type.

Returns:UnresolvedType

the component UnresolvedType object, or null.

getDimensionsback to summary
public final int getDimensions()
getErasureSignatureback to summary
public String getErasureSignature()

For parameterized types, return the signature for the raw type

getNameback to summary
public String getName()

Returns the name of this type in java language form (e.g. java.lang.Thread or boolean[]). This produces a more aesthetically pleasing string than java.lang.Class#getName().

Returns:String

the java language name of this type.

getNameAsIdentifierback to summary
public String getNameAsIdentifier()
getNamesback to summary
public static String[] getNames(UnresolvedType[] types)

Returns an array of strings representing the java langauge names of an array of types.

Parameters
types:UnresolvedType[]

an array of UnresolvedType objects

Returns:String[]

an array of Strings fo the java language names of types.

See Also
getName()
getOutermostTypeback to summary
public UnresolvedType getOutermostType()

Returns a UnresolvedType object representing the effective outermost enclosing type for a name type. For all other types, this will return the type itself. The only guarantee is given in JLS 13.1 where code generated according to those rules will have type names that can be split apart in this way.

Returns:UnresolvedType

the outermost enclosing UnresolvedType object or this.

getPackageNameback to summary
public String getPackageName()
Returns:String

the package name (no class name included)

getPackageNameAsIdentifierback to summary
public String getPackageNameAsIdentifier()
getRawNameback to summary
public String getRawName()
getRawTypeback to summary
public UnresolvedType getRawType()
getSignatureback to summary
public String getSignature()

Returns the name of this type in JVM signature form. For all UnresolvedType t:

UnresolvedType.forSignature(t.getSignature()).equals(t)
and for all String s where s is a lexically valid JVM type signature string:
UnresolvedType.forSignature(s).getSignature().equals(s)
Returns:String

the java JVM signature string for this type.

getSimpleBaseNameback to summary
public String getSimpleBaseName()
getSimpleNameback to summary
public String getSimpleName()
getSizeback to summary
public int getSize()

This is the size of this type as used in JVM.

getTypekindback to summary
public UnresolvedType.TypeKind getTypekind()
getTypeParametersback to summary
public UnresolvedType[] getTypeParameters()
getTypeVariableNamedback to summary
public TypeVariable getTypeVariableNamed(String name)

Implements org.aspectj.weaver.TypeVariableDeclaringElement.getTypeVariableNamed.

Annotations
@Override
getTypeVariablesback to summary
public TypeVariable[] getTypeVariables()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.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.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
insertback to summary
public static UnresolvedType[] insert(UnresolvedType start, UnresolvedType[] types)

Creates a new type array with a fresh type inserted at the beginning.

Parameters
start:UnresolvedType

the left hand side of the new array

types:UnresolvedType[]

the right hand side of the new array

isArrayback to summary
public final boolean isArray()
isGenericTypeback to summary
public boolean isGenericType()
isGenericWildcardback to summary
public boolean isGenericWildcard()
isParameterizedOrGenericTypeback to summary
public boolean isParameterizedOrGenericType()
isParameterizedOrRawTypeback to summary
public boolean isParameterizedOrRawType()
isParameterizedTypeback to summary
public boolean isParameterizedType()
isPrimitiveTypeback to summary
public boolean isPrimitiveType()
isRawTypeback to summary
public boolean isRawType()
isSimpleTypeback to summary
public boolean isSimpleType()
isTypeVariableReferenceback to summary
public boolean isTypeVariableReference()
isVoidback to summary
public boolean isVoid()
makeArrayback to summary
public static UnresolvedType makeArray(UnresolvedType base, int dims)
nameToSignatureback to summary
private static String nameToSignature(String name)
needsModifiableDelegateback to summary
public boolean needsModifiableDelegate()
parameterizeback to summary
public UnresolvedType parameterize(Map<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.

readback to summary
public static UnresolvedType read(DataInputStream s) throws IOException

Read in an UnresolvedType - just read the signature and rebuild the UnresolvedType.

readArrayback to summary
public static UnresolvedType[] readArray(DataInputStream s) throws IOException
resolveback to summary
public ResolvedType resolve(World world)

Returns a resolved version of this type according to a particular world.

Parameters
world:World

the World within which to resolve.

Returns:ResolvedType

a resolved type representing this type in the appropriate world.

setNeedsModifiableDelegateback to summary
public void setNeedsModifiableDelegate(boolean b)
signatureToNameback to summary
private static String signatureToName(String signature)
toDebugStringback to summary
public String toDebugString()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a java language string representation of this type.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
toTraceStringback to summary
public String toTraceString()

Implements org.aspectj.weaver.tools.Traceable.toTraceString.

Annotations
@Override
writeback to summary
public final void write(CompressingDataOutputStream s) throws IOException

Write out an UnresolvedType - the signature should be enough.

writeArrayback to summary
public static void writeArray(UnresolvedType[] types, CompressingDataOutputStream stream) throws IOException
org.aspectj.weaver back to summary

public Class UnresolvedType.TypeKind

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UnresolvedType.TypeKind
public static final UnresolvedType.TypeKind
public static final UnresolvedType.TypeKind
public static final UnresolvedType.TypeKind
public static final UnresolvedType.TypeKind
private final String
public static final UnresolvedType.TypeKind
public static final UnresolvedType.TypeKind

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

GENERICback to summary
public static final UnresolvedType.TypeKind GENERIC
PARAMETERIZEDback to summary
public static final UnresolvedType.TypeKind PARAMETERIZED
PRIMITIVEback to summary
public static final UnresolvedType.TypeKind PRIMITIVE
RAWback to summary
public static final UnresolvedType.TypeKind RAW
SIMPLEback to summary
public static final UnresolvedType.TypeKind SIMPLE
typeback to summary
private final String type
TYPE_VARIABLEback to summary
public static final UnresolvedType.TypeKind TYPE_VARIABLE
WILDCARDback to summary
public static final UnresolvedType.TypeKind WILDCARD

Constructor Detail

TypeKindback to summary
private TypeKind(String type)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override