public final class Name extends Node implements NodeWithIdentifier<Name>, NodeWithAnnotations<Name>
The rightmost identifier is "identifier", The one to the left of it is "qualifier.identifier", etc.
You can construct one from a String with the name(...) method.
SimpleName
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY
Constructor and Description |
---|
Name() |
Name(Name qualifier,
String identifier) |
Name(Name qualifier,
String identifier,
NodeList<AnnotationExpr> annotations) |
Name(String identifier) |
Name(TokenRange tokenRange,
Name qualifier,
String identifier,
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() |
Name |
clone() |
NodeList<AnnotationExpr> |
getAnnotations() |
String |
getIdentifier() |
NameMetaModel |
getMetaModel() |
Optional<Name> |
getQualifier() |
boolean |
isInternal()
An internal name is a name that constitutes a part of a larger Name instance.
|
boolean |
isTopLevel()
A top level name is a name that is not contained in a larger Name instance.
|
static Name |
parse(String qualifiedName)
Deprecated.
use JavaParser.parseName instead
|
boolean |
remove(Node node) |
Name |
removeQualifier() |
boolean |
replace(Node node,
Node replacementNode) |
Name |
setAnnotations(NodeList<AnnotationExpr> annotations) |
Name |
setIdentifier(String identifier) |
Name |
setQualifier(Name qualifier) |
addOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, 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, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
getId, setId
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
findAncestor, findParent, getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
public Name()
public Name(String identifier)
public Name(Name qualifier, String identifier, NodeList<AnnotationExpr> annotations)
public Name(TokenRange tokenRange, Name qualifier, String identifier, 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 String getIdentifier()
getIdentifier
in interface NodeWithIdentifier<Name>
public Name setIdentifier(String identifier)
setIdentifier
in interface NodeWithIdentifier<Name>
@Deprecated public static Name parse(String qualifiedName)
Name
from a qualified name.qualifiedName
- qualified nameName
public String asString()
public Name removeQualifier()
public NodeList<AnnotationExpr> getAnnotations()
getAnnotations
in interface NodeWithAnnotations<Name>
public Name setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in interface NodeWithAnnotations<Name>
public NameMetaModel getMetaModel()
getMetaModel
in class Node
public boolean isTopLevel()
public boolean isInternal()
Copyright © 2007–2018. All rights reserved.