Class TypeVariablePattern
java.lang.Object
org.aspectj.weaver.patterns.PatternNode
org.aspectj.weaver.patterns.TypeVariablePattern
- All Implemented Interfaces:
IHasPosition, IHasSourceLocation
- Author:
- colyer Represents a type variable as declared as part of a type declaration, parameter declaration, or type parameter
specification.
For example:
- <T> T genericMethod(T t) {...}
- static <T extends Foo> T staticGenericMethod(T t) {...}
- Foo<T extends Bar & IGoo>
-
Field Summary
Fields inherited from class PatternNode
end, sourceContext, start -
Constructor Summary
ConstructorsConstructorDescriptionTypeVariablePattern(String variableName) Create a named type variable with upper bound Object and no lower bounds.TypeVariablePattern(String variableName, TypePattern upperBound) Create a named type variable with the given upper bound and no lower bounds Use this constructor for the T extends Foo caseTypeVariablePattern(String variableName, TypePattern upperLimit, TypePattern[] interfaceBounds, TypePattern lowerBound) -
Method Summary
Modifier and TypeMethodDescriptionaccept(PatternNodeVisitor visitor, Object data) booleangetName()booleaninthashCode()booleanbooleanstatic TypeVariablePatternread(VersionedDataInputStream s, ISourceContext context) toString()traverse(PatternNodeVisitor visitor, Object data) voidMethods inherited from class PatternNode
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, writeLocationModifier and TypeMethodDescriptionvoidcopyLocationFrom(PatternNode other) intgetEnd()The ending index of this location in the character stream This points to the last character in this token.intgetStart()The starting index of this location in the character stream.voidreadLocation(ISourceContext context, DataInputStream s) voidsetLocation(ISourceContext sourceContext, int start, int end) void
-
Constructor Details
-
TypeVariablePattern
Create a named type variable with upper bound Object and no lower bounds. Use this constructor for the simple "T" case -
TypeVariablePattern
Create a named type variable with the given upper bound and no lower bounds Use this constructor for the T extends Foo case- Parameters:
variableName-upperBound-
-
TypeVariablePattern
public TypeVariablePattern(String variableName, TypePattern upperLimit, TypePattern[] interfaceBounds, TypePattern lowerBound)
-
-
Method Details
-
accept
- Specified by:
acceptin classPatternNode
-
traverse
- Overrides:
traversein classPatternNode
-
getName
-
isAnythingPattern
public boolean isAnythingPattern() -
getRawTypePattern
-
getUpperBound
-
hasLowerBound
public boolean hasLowerBound() -
getLowerBound
-
hasAdditionalInterfaceBounds
public boolean hasAdditionalInterfaceBounds() -
getAdditionalInterfaceBounds
-
equals
-
hashCode
-
toString
-
write
- Specified by:
writein classPatternNode- Throws:
IOException
-
read
public static TypeVariablePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException - Throws:
IOException
-