public final class TypeParameter extends ReferenceType<TypeParameter> implements NodeWithName<TypeParameter>
This class represents the declaration of a generics argument.
The TypeParameter is constructed following the syntax:TypeParameter ::= <IDENTIFIER> ( "extends"
ClassOrInterfaceType
( "&"
ClassOrInterfaceType
)* )?
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION
Constructor and Description |
---|
TypeParameter() |
TypeParameter(Range range,
String name,
List<ClassOrInterfaceType> typeBound) |
TypeParameter(Range range,
String name,
List<ClassOrInterfaceType> typeBound,
List<AnnotationExpr> annotations) |
TypeParameter(String name,
List<ClassOrInterfaceType> typeBound) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
List<AnnotationExpr> |
getAnnotations() |
String |
getName()
Return the name of the paramenter.
|
List<ClassOrInterfaceType> |
getTypeBound()
Return the list of
ClassOrInterfaceType that this parameter
extends. |
TypeParameter |
setAnnotations(List<AnnotationExpr> annotations) |
TypeParameter |
setName(String name)
Sets the name of this type parameter.
|
TypeParameter |
setTypeBound(List<ClassOrInterfaceType> typeBound)
Sets the list o types.
|
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, remove, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toStringWithoutComments, tryAddImportToParentCompilationUnit
public TypeParameter()
public TypeParameter(String name, List<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, String name, List<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, String name, List<ClassOrInterfaceType> typeBound, List<AnnotationExpr> annotations)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public String getName()
getName
in interface NodeWithName<TypeParameter>
public List<ClassOrInterfaceType> getTypeBound()
ClassOrInterfaceType
that this parameter
extends. Return null
null if there are no type.null
public TypeParameter setName(String name)
setName
in interface NodeWithName<TypeParameter>
name
- the name to setpublic TypeParameter setTypeBound(List<ClassOrInterfaceType> typeBound)
typeBound
- the typeBound to setpublic List<AnnotationExpr> getAnnotations()
getAnnotations
in class Type<TypeParameter>
public TypeParameter setAnnotations(List<AnnotationExpr> annotations)
setAnnotations
in class Type<TypeParameter>
Copyright © 2007–2016. All rights reserved.