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, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
TypeParameter() |
TypeParameter(Range range,
String name,
NodeList<ClassOrInterfaceType> typeBound) |
TypeParameter(Range range,
String name,
NodeList<ClassOrInterfaceType> typeBound,
NodeList<AnnotationExpr> annotations) |
TypeParameter(String name,
NodeList<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.
|
NodeList<AnnotationExpr> |
getAnnotations() |
String |
getName()
Return the name of the paramenter.
|
NodeList<ClassOrInterfaceType> |
getTypeBound()
Return the list of
ClassOrInterfaceType that this parameter
extends. |
TypeParameter |
setAnnotations(NodeList<AnnotationExpr> annotations) |
TypeParameter |
setName(String name) |
TypeParameter |
setTypeBound(NodeList<ClassOrInterfaceType> typeBound) |
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, remove, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toString, tryAddImportToParentCompilationUnit
finalize, getClass, notify, notifyAll, wait, wait, wait
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public TypeParameter()
public TypeParameter(String name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, String name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, String name, NodeList<ClassOrInterfaceType> typeBound, NodeList<AnnotationExpr> annotations)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
public String getName()
getName
in interface NodeWithName<TypeParameter>
public NodeList<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>
public TypeParameter setTypeBound(NodeList<ClassOrInterfaceType> typeBound)
public NodeList<AnnotationExpr> getAnnotations()
getAnnotations
in class Type<TypeParameter>
public TypeParameter setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in class Type<TypeParameter>
Copyright © 2007–2016. All rights reserved.