public final 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.ObserverRegistrationMode, Node.ParsednessABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration| Constructor and Description |
|---|
TypeParameter() |
TypeParameter(Range range,
SimpleName name,
NodeList<ClassOrInterfaceType> typeBound)
Deprecated.
range shouldn't be in utility constructors.
|
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 |
clone() |
TypeParameterMetaModel |
getMetaModel() |
SimpleName |
getName()
Return the name of the paramenter.
|
List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
NodeList<ClassOrInterfaceType> |
getTypeBound()
Return the list of
ClassOrInterfaceType that this parameter
extends. |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
TypeParameter |
setAnnotations(NodeList<AnnotationExpr> annotations) |
TypeParameter |
setName(SimpleName name) |
TypeParameter |
setTypeBound(NodeList<ClassOrInterfaceType> typeBound) |
getAnnotation, getAnnotations, getArrayLevel, getElementTypeaddOrphanComment, customInitialization, equals, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregisterfinalize, getClass, notify, notifyAll, wait, wait, waitgetNameAsString, setNameaddAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnitgetAncestorOfTypecontainsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBeforepublic TypeParameter()
public TypeParameter(String name)
public TypeParameter(String name, NodeList<ClassOrInterfaceType> typeBound)
@Deprecated public TypeParameter(Range range, SimpleName name, NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter(SimpleName name, NodeList<ClassOrInterfaceType> typeBound, NodeList<AnnotationExpr> annotations)
@Generated(value="com.github.javaparser.generator.core.node.MainConstructorGenerator") 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)
Visitable@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public SimpleName getName()
getName in interface NodeWithSimpleName<TypeParameter>@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ClassOrInterfaceType> getTypeBound()
ClassOrInterfaceType that this parameter
extends. Return null null if there are no type.null@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public TypeParameter setName(SimpleName name)
setName in interface NodeWithSimpleName<TypeParameter>@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public TypeParameter setTypeBound(NodeList<ClassOrInterfaceType> typeBound)
public TypeParameter setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations in interface NodeWithAnnotations<TypeParameter>setAnnotations in class Type@Generated(value="com.github.javaparser.generator.core.node.GetNodeListsGenerator") public List<NodeList<?>> getNodeLists()
NodegetNodeLists in class Node@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove in class ReferenceType@Generated(value="com.github.javaparser.generator.core.node.CloneGenerator") public TypeParameter clone()
clone in class ReferenceType@Generated(value="com.github.javaparser.generator.core.node.GetMetaModelGenerator") public TypeParameterMetaModel getMetaModel()
getMetaModel in class ReferenceType@Generated(value="com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace in class ReferenceTypeCopyright © 2007–2024. All rights reserved.