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.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversalABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY| 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 |
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, asVoidType, asWildcardType, getAnnotation, getAnnotations, getArrayLevel, getElementType, ifArrayType, ifClassOrInterfaceType, ifIntersectionType, ifPrimitiveType, ifUnionType, ifUnknownType, ifVoidType, ifWildcardType, isArrayType, isClassOrInterfaceType, isIntersectionType, isPrimitiveType, isUnionType, isUnknownType, isVoidType, isWildcardType, toArrayType, toClassOrInterfaceType, toIntersectionType, toPrimitiveType, toUnionType, toUnknownType, toVoidType, toWildcardTypeaddOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findParent, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walkfinalize, 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)
@Generated(value="com.github.javaparser.generator.core.node.AcceptGenerator") 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)@Generated(value="com.github.javaparser.generator.core.node.AcceptGenerator") 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.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 ReferenceType@Generated(value="com.github.javaparser.generator.core.node.TypeCastingGenerator") public boolean isTypeParameter()
isTypeParameter in class Type@Generated(value="com.github.javaparser.generator.core.node.TypeCastingGenerator") public TypeParameter asTypeParameter()
asTypeParameter in class Type@Generated(value="com.github.javaparser.generator.core.node.TypeCastingGenerator") public void ifTypeParameter(Consumer<TypeParameter> action)
ifTypeParameter in class Typepublic ResolvedTypeVariable resolve()
resolve in interface Resolvable<Object>resolve in class Typepublic Optional<TypeParameter> toTypeParameter()
toTypeParameter in class TypeCopyright © 2007–2017. All rights reserved.