Package com.google.javascript.rhino
Class QualifiedName
java.lang.Object
com.google.javascript.rhino.QualifiedName
Abstraction over a qualified name. Unifies Node-based qualified names and string-based names,
allowing to lazily parse strings and represent a pre-parsed qualified name without the overhead
of a whole Node. Essentially, a qualified name is a linked list of components, starting from the outermost property access and ending with the root of the name,
which is a simple name with no owner.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the components of this name as an iterable of strings, starting at the root.abstract String
Returns outer-most term of this qualified name, or the entire name for simple names.abstract @Nullable QualifiedName
getOwner()
Returns the qualified name of the owner, or null for simple names.Returns a new qualified name object withthis
name as the owner and the given string as the property name.getRoot()
Returns the root of this name, e.g.abstract boolean
isSimple()
Returns true if this is a simple name.join()
Returns the qualified name as a string.abstract boolean
Checks whether the given node matches this name.static QualifiedName
-
Method Details
-
of
-
getOwner
Returns the qualified name of the owner, or null for simple names. For the name "foo.bar.baz", this returns an object representing "foo.bar". -
getComponent
Returns outer-most term of this qualified name, or the entire name for simple names. For the name "foo.bar.baz", this returns "baz". -
isSimple
public abstract boolean isSimple()Returns true if this is a simple name. -
matches
Checks whether the given node matches this name. -
getRoot
Returns the root of this name, e.g. "foo" from "foo.bar.baz". -
components
Returns the components of this name as an iterable of strings, starting at the root. For the qualified name foo.bar.baz, this returns ["foo", "bar", "baz"]. -
join
Returns the qualified name as a string. -
getprop
Returns a new qualified name object withthis
name as the owner and the given string as the property name.
-