Class TypeVariable

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

public class TypeVariable extends Object
Represents a type variable with possible bounds.
Author:
Adrian Colyer, Andy Clement
  • Field Details

  • Constructor Details

  • Method Details

    • 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 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 String toDebugString()
    • getDisplayName

      public String getDisplayName()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSignature

      public 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 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 IOException
      Throws:
      IOException
    • read

      public static TypeVariable read​(VersionedDataInputStream s) throws IOException
      Throws:
      IOException
    • getGenericSignature

      public String getGenericSignature()
    • getErasureSignature

      public String getErasureSignature()
    • getSuperclass

      public UnresolvedType getSuperclass()
    • setSuperclass

      public void setSuperclass​(UnresolvedType superclass)