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.
NodeWithTypeParameters
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, 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() |
ResolvedType |
convertToUsage(Context context) |
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) |
String |
toDescriptor() |
Optional<TypeParameter> |
toTypeParameter() |
asReferenceType, ifReferenceType, isReferenceType, toReferenceType
asArrayType, 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, toWildcardType
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
getNameAsExpression, getNameAsString, setName
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOf
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
public 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)
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 TypeParameter setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in interface NodeWithAnnotations<TypeParameter>
setAnnotations
in class Type
public String toDescriptor()
toDescriptor
in class ReferenceType
public TypeParameter clone()
clone
in class ReferenceType
public TypeParameterMetaModel getMetaModel()
getMetaModel
in class ReferenceType
public boolean isTypeParameter()
isTypeParameter
in class Type
public TypeParameter asTypeParameter()
asTypeParameter
in class Type
public void ifTypeParameter(Consumer<TypeParameter> action)
ifTypeParameter
in class Type
public ResolvedTypeVariable resolve()
resolve
in interface Resolvable<ResolvedType>
resolve
in class Type
public Optional<TypeParameter> toTypeParameter()
toTypeParameter
in class Type
public ResolvedType convertToUsage(Context context)
convertToUsage
in interface ConvertibleToUsage
Copyright © 2007–2023. All rights reserved.