public class TypeParameter extends ReferenceType implements NodeWithSimpleName<TypeParameter>, NodeWithAnnotations<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.
NodeWithTypeParametersNode.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversalABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY| Constructor and Description |
|---|
TypeParameter() |
TypeParameter(SimpleName name,
NodeList<ClassOrInterfaceType> typeBound,
NodeList<AnnotationExpr> annotations) |
TypeParameter(String name) |
TypeParameter(String name,
NodeList<ClassOrInterfaceType> typeBound) |
TypeParameter(TokenRange tokenRange,
SimpleName name,
NodeList<ClassOrInterfaceType> typeBound,
NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
|
| 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.
|
String |
asString() |
TypeParameter |
asTypeParameter() |
TypeParameter |
clone() |
TypeParameterMetaModel |
getMetaModel() |
SimpleName |
getName()
Return the name of the paramenter.
|
NodeList<ClassOrInterfaceType> |
getTypeBound()
Return the list of
ClassOrInterfaceType that this parameter
extends. |
void |
ifTypeParameter(Consumer<TypeParameter> action) |
boolean |
isTypeParameter() |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
ResolvedTypeVariable |
resolve() |
TypeParameter |
setAnnotations(NodeList<AnnotationExpr> annotations) |
TypeParameter |
setName(SimpleName name) |
TypeParameter |
setTypeBound(NodeList<ClassOrInterfaceType> typeBound) |
Optional<TypeParameter> |
toTypeParameter() |
asReferenceType, ifReferenceType, isReferenceType, toReferenceTypeasArrayType, asClassOrInterfaceType, asIntersectionType, asPrimitiveType, asUnionType, asUnknownType, asVarType, asVoidType, asWildcardType, getAnnotation, getAnnotations, getArrayLevel, getElementType, ifArrayType, ifClassOrInterfaceType, ifIntersectionType, ifPrimitiveType, ifUnionType, ifUnknownType, ifVarType, ifVoidType, ifWildcardType, isArrayType, isClassOrInterfaceType, isIntersectionType, isPrimitiveType, isUnionType, isUnknownType, isVarType, isVoidType, isWildcardType, toArrayType, toClassOrInterfaceType, toIntersectionType, toPrimitiveType, toUnionType, toUnknownType, toVarType, toVoidType, toWildcardTypeaddOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, getToStringPrettyPrinterConfiguration, hashCode, isAncestorOf, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, setToStringPrettyPrinterConfiguration, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walkfinalize, getClass, notify, notifyAll, wait, wait, waitgetNameAsExpression, getNameAsString, setNameaddAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnitfindAncestor, findAncestor, isDescendantOfcontainsWithin, containsWithinRange, getBegin, getEndpublic TypeParameter()
public TypeParameter(String name)
public TypeParameter(String name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(SimpleName name, NodeList<ClassOrInterfaceType> typeBound, NodeList<AnnotationExpr> annotations)
public TypeParameter(TokenRange tokenRange, SimpleName name, NodeList<ClassOrInterfaceType> typeBound, NodeList<AnnotationExpr> annotations)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitableaccept in interface VisitableR - 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)
Visitablepublic SimpleName getName()
getName in interface NodeWithSimpleName<TypeParameter>public NodeList<ClassOrInterfaceType> getTypeBound()
ClassOrInterfaceType that this parameter
extends. Return null null if there are no type.nullpublic TypeParameter setName(SimpleName name)
setName in interface NodeWithSimpleName<TypeParameter>public TypeParameter setTypeBound(NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations in interface NodeWithAnnotations<TypeParameter>setAnnotations in class Typepublic boolean remove(Node node)
remove in class ReferenceTypepublic TypeParameter clone()
clone in class ReferenceTypepublic TypeParameterMetaModel getMetaModel()
getMetaModel in class ReferenceTypepublic boolean replace(Node node, Node replacementNode)
replace in class ReferenceTypepublic boolean isTypeParameter()
isTypeParameter in class Typepublic TypeParameter asTypeParameter()
asTypeParameter in class Typepublic void ifTypeParameter(Consumer<TypeParameter> action)
ifTypeParameter in class Typepublic ResolvedTypeVariable resolve()
resolve in interface Resolvable<ResolvedType>resolve in class Typepublic Optional<TypeParameter> toTypeParameter()
toTypeParameter in class TypeCopyright © 2007–2020. All rights reserved.