public final class TypeParameter extends ReferenceType<TypeParameter> implements NodeWithSimpleName<TypeParameter>
This class represents the declaration of a generics argument.
The TypeParameter is constructed following the syntax:TypeParameter ::= <IDENTIFIER> ( "extends"
ClassOrInterfaceType
( "&"
ClassOrInterfaceType
)* )?
Node.ObserverRegistrationMode
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
TypeParameter() |
TypeParameter(Range range,
SimpleName name,
NodeList<ClassOrInterfaceType> typeBound) |
TypeParameter(Range range,
SimpleName 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() |
SimpleName |
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(SimpleName name) |
TypeParameter |
setTypeBound(NodeList<ClassOrInterfaceType> typeBound) |
getAnnotation
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getEnd, getNodeLists, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
getNameAsString, setName
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public TypeParameter()
public TypeParameter(String name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, SimpleName name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(Range range, SimpleName 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 SimpleName getName()
getName
in interface NodeWithSimpleName<TypeParameter>
public NodeList<ClassOrInterfaceType> getTypeBound()
ClassOrInterfaceType
that this parameter
extends. Return null
null if there are no type.null
public TypeParameter setName(SimpleName name)
setName
in interface NodeWithSimpleName<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.