Package org.apache.jackrabbit.spi
Interface Path.Element
-
- All Superinterfaces:
java.io.Serializable
- Enclosing interface:
- Path
public static interface Path.Element extends java.io.Serializable
Object representation of a single JCR path element. AnElement
object contains theName
and optional index of a single JCR path element.Once created, a
Element
object must be immutable.The String presentation of an
Element
must be in the format "{namespaceURI}localPart
" or "{namespaceURI}localPart[index]
" case of an index greater thanPath.INDEX_DEFAULT
.Note, that the implementation must implement the equals method such, that two
Element
objects having equalsName
s and the same normalized index must be equal.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
denotesCurrent()
Returnstrue
if this element denotes the current ('.') element, otherwise returnsfalse
.boolean
denotesIdentifier()
Returnstrue
if this element represents an identifier element.boolean
denotesName()
Returnstrue
if this element represents a regular name (i.e.boolean
denotesParent()
Returnstrue
if this element denotes the parent ('..') element, otherwise returnsfalse
.boolean
denotesRoot()
Returnstrue
if this element denotes the root element, otherwise returnsfalse
.java.lang.String
getIdentifier()
Returns the identifier of an identifier element, ornull
for other kinds of elements.int
getIndex()
Returns the index of the element as it has been assigned upon creation.Name
getName()
Returns the name of this path element.int
getNormalizedIndex()
Returns the normalized index of this path element, i.e.java.lang.String
getString()
Return the String presentation of aPath.Element
.
-
-
-
Method Detail
-
getName
Name getName()
Returns the name of this path element.- Returns:
- The name of this path element.
-
getIndex
int getIndex()
Returns the index of the element as it has been assigned upon creation.- Returns:
- index of the element as it has been assigned upon creation.
-
getNormalizedIndex
int getNormalizedIndex()
Returns the normalized index of this path element, i.e. the index is always equals or greater thatPath.INDEX_DEFAULT
.- Returns:
- the normalized index.
-
getIdentifier
java.lang.String getIdentifier()
Returns the identifier of an identifier element, ornull
for other kinds of elements.- Returns:
- identifier, or
null
-
denotesRoot
boolean denotesRoot()
Returnstrue
if this element denotes the root element, otherwise returnsfalse
.- Returns:
true
if this element denotes the root element; otherwisefalse
-
denotesParent
boolean denotesParent()
Returnstrue
if this element denotes the parent ('..') element, otherwise returnsfalse
.- Returns:
true
if this element denotes the parent element; otherwisefalse
-
denotesCurrent
boolean denotesCurrent()
Returnstrue
if this element denotes the current ('.') element, otherwise returnsfalse
.- Returns:
true
if this element denotes the current element; otherwisefalse
-
denotesName
boolean denotesName()
Returnstrue
if this element represents a regular name (i.e. neither root, '.' nor '..'), otherwise returnsfalse
.- Returns:
true
if this element represents a regular name; otherwisefalse
-
denotesIdentifier
boolean denotesIdentifier()
Returnstrue
if this element represents an identifier element.- Returns:
true
if this element represents an identifier element.- Since:
- JCR 2.0
-
getString
java.lang.String getString()
Return the String presentation of aPath.Element
. It must be in the format "{namespaceURI}localPart
" or "{namespaceURI}localPart[index]
" in case of an index greater thanPath.INDEX_DEFAULT
.- Returns:
- String representation of a
Path.Element
.
-
-