Package org.aspectj.weaver.patterns
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 org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start
-
Constructor Summary
ConstructorDescriptionTypeVariablePattern
(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) boolean
getName()
boolean
int
hashCode()
boolean
boolean
static TypeVariablePattern
read
(VersionedDataInputStream s, ISourceContext context) toString()
void
Methods inherited from class org.aspectj.weaver.patterns.PatternNode
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, writeLocation
-
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:
accept
in classPatternNode
-
getName
-
isAnythingPattern
public boolean isAnythingPattern() -
getRawTypePattern
-
getUpperBound
-
hasLowerBound
public boolean hasLowerBound() -
getLowerBound
-
hasAdditionalInterfaceBounds
public boolean hasAdditionalInterfaceBounds() -
getAdditionalInterfaceBounds
-
equals
-
hashCode
public int hashCode() -
toString
-
write
- Specified by:
write
in classPatternNode
- Throws:
IOException
-
read
public static TypeVariablePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException - Throws:
IOException
-