org.aspectj.weaver
Class TypeVariable
java.lang.Object
org.aspectj.weaver.TypeVariable
public class TypeVariable
- extends java.lang.Object
Represents a type variable with possible bounds.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NONE
public static final TypeVariable[] NONE
UNKNOWN
public static final int UNKNOWN
- See Also:
- Constant Field Values
METHOD
public static final int METHOD
- See Also:
- Constant Field Values
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
isResolved
public boolean isResolved
TypeVariable
public TypeVariable(java.lang.String name)
- Constructor for an unbound type variable, eg. 'T'
TypeVariable
public TypeVariable(java.lang.String name,
UnresolvedType anUpperBound)
TypeVariable
public TypeVariable(java.lang.String name,
UnresolvedType anUpperBound,
UnresolvedType[] superInterfaces)
getFirstBound
public UnresolvedType getFirstBound()
- Returns:
- the first bound, either the superclass or if non is specified the first interface or if non are specified then OBJECT
getUpperBound
public UnresolvedType getUpperBound()
getSuperInterfaces
public UnresolvedType[] getSuperInterfaces()
getName
public java.lang.String getName()
resolve
public TypeVariable resolve(World world)
- resolve all the bounds of this type variable
canBeBoundTo
public boolean canBeBoundTo(ResolvedType candidate)
- answer true if the given type satisfies all of the bound constraints of this type variable. If type variable has not been
resolved then throws IllegalStateException
setUpperBound
public void setUpperBound(UnresolvedType superclass)
setAdditionalInterfaceBounds
public void setAdditionalInterfaceBounds(UnresolvedType[] superInterfaces)
toDebugString
public java.lang.String toDebugString()
getDisplayName
public java.lang.String getDisplayName()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getSignature
public java.lang.String getSignature()
- Return complete signature, e.g. "T extends Number" would return "T:Ljava/lang/Number;" note: MAY INCLUDE P types if bounds
are parameterized types
getSignatureForAttribute
public java.lang.String getSignatureForAttribute()
- Returns:
- signature for inclusion in an attribute, there must be no 'P' in it signatures
setRank
public void setRank(int rank)
getRank
public int getRank()
setDeclaringElement
public void setDeclaringElement(TypeVariableDeclaringElement element)
getDeclaringElement
public TypeVariableDeclaringElement getDeclaringElement()
setDeclaringElementKind
public void setDeclaringElementKind(int kind)
getDeclaringElementKind
public int getDeclaringElementKind()
write
public void write(CompressingDataOutputStream s)
throws java.io.IOException
- Throws:
java.io.IOException
read
public static TypeVariable read(VersionedDataInputStream s)
throws java.io.IOException
- Throws:
java.io.IOException
getGenericSignature
public java.lang.String getGenericSignature()
getErasureSignature
public java.lang.String getErasureSignature()
getSuperclass
public UnresolvedType getSuperclass()
setSuperclass
public void setSuperclass(UnresolvedType superclass)