| java.lang.Object | |
| ↳ | com.google.gdata.model.Path |
The Path class represents an immutable path to a model entity in the GData
DOM. A path can be absolute (the root ElementMetadata for the path is
specified at construction time or relative (the root element type is unknown
at construction time).
The toAbsolute(ElementMetadata) method can be used to produce an
absolute path from a relative path by interpreting it relative to a root.
New paths can be constructed using the of(MetadataKey) or
#to(ElementMetadata, MetadataKey...) methods as well as using the
builder() method to obtain a new Path.Builder instance that can
be used for incremental path construction.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Path.Builder | The Builder class provides a model for incrementally constructing new
Path relative or absolute instances. |
||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ROOT | A simple relative path that selects the root of the path. | ||||||||||
| root | root element type of the path (if absolute) or null (if relative) | ||||||||||
| selectedAttribute | attribute selected by the path or null (if relative or an element path | ||||||||||
| selectedElement | element selected by the path or null (if relative) | ||||||||||
| selectsAttribute | true if the path selects an attribute, false otherwise | ||||||||||
| steps | path steps | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
The equals method will return true if the target object is also a
Path, has the same root or is also relative, and has the same list
of path steps. | |||||||||||
Returns the element key for the second-to-last key in the path.
| |||||||||||
Returns the attribute type currently selected by the path or
null
if the path selects an element or is relative. | |||||||||||
Returns the attribute key at the end of the path.
| |||||||||||
Returns the element type currently selected by the path or
null
if the path is relative. | |||||||||||
Returns the element key at the end of the path.
| |||||||||||
Returns the list of path steps.
| |||||||||||
Returns
true if path is relative
| |||||||||||
Constructs a new relative
Path that selects an element defined by
the set of path steps to the element. | |||||||||||
Returns
true if the path selects an attribute. | |||||||||||
Returns
true if the path selects an element. | |||||||||||
Constructs a new absolute
Path to an element type as defined by a
root type and the relative steps from it to the selected type. | |||||||||||
Constructs a new
Path instance by interpreting the steps in the
current path relative to the provided root ElementMetadata. | |||||||||||
The
toString() implementation is overridden to return the XPath
string that represents the path. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
root element type of the path (if absolute) or null (if relative)
attribute selected by the path or null (if relative or an element path
element selected by the path or null (if relative)
true if the path selects an attribute, false otherwise
The equals method will return true if the target object is also a
Path, has the same root or is also relative, and has the same list
of path steps.
| o |
|---|
Returns the element key for the second-to-last key in the path. If the
path is only a single step this method will return null.
Returns the attribute type currently selected by the path or null
if the path selects an element or is relative.
Returns the attribute key at the end of the path.
| IllegalStateException | if this path is not to an attribute. |
|---|
Returns the element type currently selected by the path or null
if the path is relative.
Returns the element key at the end of the path.
| IllegalStateException | if this path is not to an element. |
|---|
Returns true if path is relative
Constructs a new relative Path that selects an element defined by
the set of path steps to the element.
| steps | Keys defining steps to the selected element |
|---|
Returns true if the path selects an attribute.
Returns true if the path selects an element.
Constructs a new absolute Path to an element type as defined by a
root type and the relative steps from it to the selected type.
| root | |
|---|---|
| keys | Keys defining steps to the selected element |
| PathException | if this path has been bound to a metadata instance and no key with the given step can be found, or if the path is an attribute path. Once a path has an attribute key no more steps may be added. |
|---|---|
| NullPointerException | if root is null. |
Constructs a new Path instance by interpreting the steps in the
current path relative to the provided root ElementMetadata.
| root | Root of returned path |
|---|
Path bound to the root element metadata.| PathException | if the path is not found in the metadata. |
|---|---|
| NullPointerException | if root is null. |
The toString() implementation is overridden to return the XPath
string that represents the path.