Class NamespaceNameTreeImpl
- java.lang.Object
-
- org.sonar.php.tree.impl.PHPTree
-
- org.sonar.php.tree.impl.declaration.NamespaceNameTreeImpl
-
- All Implemented Interfaces:
NamespaceNameTree
,TypeNameTree
,ExpressionTree
,Tree
- Direct Known Subclasses:
ClassNamespaceNameTreeImpl
public class NamespaceNameTreeImpl extends PHPTree implements NamespaceNameTree
-
-
Constructor Summary
Constructors Constructor Description NamespaceNameTreeImpl(SyntaxToken absoluteSeparator, SeparatedList<NameIdentifierTree> namespaces, IdentifierTree name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SyntaxToken
absoluteSeparator()
void
accept(VisitorCheck visitor)
Iterator<Tree>
childrenIterator()
Creates iterator for children of this node.String
fullName()
Return the concatenation of: absolute separator (if present) namespaces with separators (if present) nameString
fullyQualifiedName()
Return the fully qualified form of the namespaced name, with the namespaces and separators if present and the absolute separator if present.Tree.Kind
getKind()
boolean
hasQualifiers()
Return true if the namespace name has namespace separator.boolean
isFullyQualified()
Return true if the namespace name starts with a namespace separator.IdentifierTree
name()
SeparatedList<NameIdentifierTree>
namespaces()
String
qualifiedName()
Return the qualified form of the namespaced name, with the namespaces and separators if present, only the name otherwise.String
unqualifiedName()
Return the unqualified form of the namespaced name, means it will return just the String value of the name.-
Methods inherited from class org.sonar.php.tree.impl.PHPTree
getFirstToken, getLastToken, getLine, getParent, is, isLeaf, setParent, toString
-
-
-
-
Constructor Detail
-
NamespaceNameTreeImpl
public NamespaceNameTreeImpl(@Nullable SyntaxToken absoluteSeparator, SeparatedList<NameIdentifierTree> namespaces, IdentifierTree name)
-
-
Method Detail
-
absoluteSeparator
@Nullable public SyntaxToken absoluteSeparator()
- Specified by:
absoluteSeparator
in interfaceNamespaceNameTree
-
namespaces
public SeparatedList<NameIdentifierTree> namespaces()
- Specified by:
namespaces
in interfaceNamespaceNameTree
-
name
public IdentifierTree name()
- Specified by:
name
in interfaceNamespaceNameTree
-
fullName
public String fullName()
Description copied from interface:NamespaceNameTree
Return the concatenation of:- absolute separator (if present)
- namespaces with separators (if present)
- name
- Specified by:
fullName
in interfaceNamespaceNameTree
-
unqualifiedName
public String unqualifiedName()
Description copied from interface:NamespaceNameTree
Return the unqualified form of the namespaced name, means it will return just the String value of the name.Example:
\Foo\Bar => return "Bar" Foo\Bar => return "Bar" Bar => return "Bar"
- Specified by:
unqualifiedName
in interfaceNamespaceNameTree
-
qualifiedName
public String qualifiedName()
Description copied from interface:NamespaceNameTree
Return the qualified form of the namespaced name, with the namespaces and separators if present, only the name otherwise.Example:
\Foo\Bar => return "Foo\Bar" Foo\Bar => return "Foo\Bar" Bar => return "Bar"
- Specified by:
qualifiedName
in interfaceNamespaceNameTree
-
fullyQualifiedName
public String fullyQualifiedName()
Description copied from interface:NamespaceNameTree
Return the fully qualified form of the namespaced name, with the namespaces and separators if present and the absolute separator if present.Example:
\Foo\Bar => return "\Foo\Bar" Foo\Bar => return "Foo\Bar" Bar => return "Bar"
- Specified by:
fullyQualifiedName
in interfaceNamespaceNameTree
-
isFullyQualified
public boolean isFullyQualified()
Description copied from interface:NamespaceNameTree
Return true if the namespace name starts with a namespace separator.Example:
\Foo\Bar \AnotherFoo
- Specified by:
isFullyQualified
in interfaceNamespaceNameTree
-
hasQualifiers
public boolean hasQualifiers()
Description copied from interface:NamespaceNameTree
Return true if the namespace name has namespace separator.Example:
Foo\Bar
- Specified by:
hasQualifiers
in interfaceNamespaceNameTree
-
childrenIterator
public Iterator<Tree> childrenIterator()
Description copied from class:PHPTree
Creates iterator for children of this node. Note that iterator may containnull
elements.- Specified by:
childrenIterator
in classPHPTree
-
accept
public void accept(VisitorCheck visitor)
-
-