Interface NamespaceNameTree

All Superinterfaces:
ExpressionTree, Tree, TypeNameTree
All Known Implementing Classes:
ClassNamespaceNameTreeImpl, NamespaceNameTreeImpl

public interface NamespaceNameTree extends ExpressionTree, TypeNameTree
Namespace name
  • Unqualified name: this is an identifier without a namespace separator, such as Foo
  • Qualified name: this is an identifier with a namespace separator, such as Foo\Bar
  • Fully qualified name: this is an identifier with a namespace separator that begins with a namespace separator, such as \Foo\Bar. The namespace \Foo is also a fully qualified name.
  name()                                  // unqualified
  namespaces() name()                     // qualified
  absoluteSeparator() namespaces() name() // fully qualified
 
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.sonar.plugins.php.api.tree.Tree

    Tree.Kind
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Return the concatenation of: absolute separator (if present) namespaces with separators (if present) name
    Return the fully qualified form of the namespaced name, with the namespaces and separators if present and the absolute separator if present.
    boolean
    Return true if the namespace name has namespace separator.
    boolean
    Return true if the namespace name starts with a namespace separator.
     
     
    Return the qualified form of the namespaced name, with the namespaces and separators if present, only the name otherwise.
    Return the unqualified form of the namespaced name, means it will return just the String value of the name.

    Methods inherited from interface org.sonar.plugins.php.api.tree.Tree

    accept, getKind, getParent, is
  • Method Details

    • absoluteSeparator

      @Nullable SyntaxToken absoluteSeparator()
    • namespaces

    • name

    • fullName

      String fullName()
      Return the concatenation of:
      • absolute separator (if present)
      • namespaces with separators (if present)
      • name
    • unqualifiedName

      String unqualifiedName()
      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"
       
    • qualifiedName

      String qualifiedName()
      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"
       
    • fullyQualifiedName

      String fullyQualifiedName()
      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"
       
    • isFullyQualified

      boolean isFullyQualified()
      Return true if the namespace name starts with a namespace separator.

      Example:

        \Foo\Bar
        \AnotherFoo
       
    • hasQualifiers

      boolean hasQualifiers()
      Return true if the namespace name has namespace separator.

      Example:

        Foo\Bar