public final class TypeParameter extends ReferenceType<TypeParameter> implements NodeWithSimpleName<TypeParameter>
<U> U getU() { ... }
class D <@Brain T extends B & A & @Tripe C> { ... }
U and T are type parameter names.
B, A, and C are type parameter bounds.
Tripe is an annotation on type parameter bound C.
Brain is an annotation on type parameter T.
NodeWithTypeParameters
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, getArrayLevel, getElementType
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodeLists, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, hasJavaDocComment, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, 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
public TypeParameter setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in class Type
Copyright © 2007–2017. All rights reserved.