org.aspectj.weaver
Class TypeVariable

java.lang.Object
  extended by org.aspectj.weaver.TypeVariable

public class TypeVariable
extends java.lang.Object

Represents a type variable with possible bounds.


Field Summary
 boolean isResolved
           
static int METHOD
           
static TypeVariable[] NONE
           
static int TYPE
           
static int UNKNOWN
           
 
Constructor Summary
TypeVariable(java.lang.String name)
          Constructor for an unbound type variable, eg.
TypeVariable(java.lang.String name, UnresolvedType anUpperBound)
           
TypeVariable(java.lang.String name, UnresolvedType anUpperBound, UnresolvedType[] superInterfaces)
           
 
Method Summary
 boolean canBeBoundTo(ResolvedType candidate)
          answer true if the given type satisfies all of the bound constraints of this type variable.
 TypeVariableDeclaringElement getDeclaringElement()
           
 int getDeclaringElementKind()
           
 java.lang.String getDisplayName()
           
 java.lang.String getErasureSignature()
           
 UnresolvedType getFirstBound()
           
 java.lang.String getGenericSignature()
           
 java.lang.String getName()
           
 int getRank()
           
 java.lang.String getSignature()
          Return complete signature, e.g.
 java.lang.String getSignatureForAttribute()
           
 UnresolvedType getSuperclass()
           
 UnresolvedType[] getSuperInterfaces()
           
 UnresolvedType getUpperBound()
           
static TypeVariable read(VersionedDataInputStream s)
           
 TypeVariable resolve(World world)
          resolve all the bounds of this type variable
 void setAdditionalInterfaceBounds(UnresolvedType[] superInterfaces)
           
 void setDeclaringElement(TypeVariableDeclaringElement element)
           
 void setDeclaringElementKind(int kind)
           
 void setRank(int rank)
           
 void setSuperclass(UnresolvedType superclass)
           
 void setUpperBound(UnresolvedType superclass)
           
 java.lang.String toDebugString()
           
 java.lang.String toString()
           
 void write(CompressingDataOutputStream s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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)