|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.name.Path.PathElement
public abstract static class Path.PathElement
Object representation of a single JCR path element. A PathElement object contains the qualified name and optional index of a single JCR path element.
Once created, a PathElement object is immutable.
Method Summary | |
---|---|
static Path.PathElement |
create(QName name)
Creates a path element with the given qualified name. |
static Path.PathElement |
create(QName name,
int index)
Same as create(QName) except that an explicit index can be
specified. |
abstract boolean |
denotesCurrent()
Returns true if this element denotes the current
('.') element, otherwise returns false . |
abstract boolean |
denotesName()
Returns true if this element represents a regular name
(i.e. |
abstract boolean |
denotesParent()
Returns true if this element denotes the parent
('..') element, otherwise returns false . |
abstract boolean |
denotesRoot()
Returns true if this element denotes the root element,
otherwise returns false . |
boolean |
equals(Object obj)
Check for path element equality. |
static Path.PathElement |
fromString(String s)
Parses the given path element string into a path element object. |
int |
getIndex()
Returns the 1-based index or 0 if no index was specified (which is equivalent to specifying 1). |
QName |
getName()
Returns the qualified name of this path element. |
int |
getNormalizedIndex()
Returns the normalized index of this path element, i.e. |
int |
hashCode()
Computes a hash code for this path element. |
String |
toJCRName(NamespaceResolver resolver)
Returns the JCR name representation of this path element. |
void |
toJCRName(NamespaceResolver resolver,
StringBuffer buf)
Appends the JCR name representation of this path element to the given string buffer. |
String |
toString()
Returns a string representation of this path element. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Path.PathElement create(QName name)
Path.PARENT_ELEMENT
, Path.CURRENT_ELEMENT
or
Path.ROOT_ELEMENT
) then the associated constant is returned.
name
- the name of the element
IllegalArgumentException
- if the name is null
public static Path.PathElement create(QName name, int index)
create(QName)
except that an explicit index can be
specified.
Note that an IllegalArgumentException will be thrown if the specified
name denotes a special path element (either
Path.PARENT_ELEMENT
, Path.CURRENT_ELEMENT
or
Path.ROOT_ELEMENT
) since an explicit index is not allowed
in this context.
name
- the name of the elementindex
- the 1-based index.
IllegalArgumentException
- if the name is null
,
if the given index is less than 1
or if name denoting a special path
element and an index greater than 1
have been specified.public QName getName()
public int getIndex()
public int getNormalizedIndex()
Path.INDEX_DEFAULT
.
public String toJCRName(NamespaceResolver resolver) throws NoPrefixDeclaredException
resolver
- namespace resolver
NoPrefixDeclaredException
- if the namespace of the path
element name can not be resolvedpublic void toJCRName(NamespaceResolver resolver, StringBuffer buf) throws NoPrefixDeclaredException
resolver
- namespace resolverbuf
- string buffer where the JCR name representation
should be appended to
NoPrefixDeclaredException
- if the namespace of the path
element name can not be resolvedtoJCRName(NamespaceResolver)
public String toString()
{uri}name
syntax. Use the toJCRName
method to get the prefixed string representation of the path element.
toString
in class Object
Object.toString()
public static Path.PathElement fromString(String s) throws IllegalArgumentException
s
- path element string
IllegalArgumentException
- if the given path element string
is null
or if its
format is invalidpublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare with
true
if the path elements are equalpublic abstract boolean denotesRoot()
true
if this element denotes the root element,
otherwise returns false
.
true
if this element denotes the root
element; otherwise false
public abstract boolean denotesParent()
true
if this element denotes the parent
('..') element, otherwise returns false
.
true
if this element denotes the parent
element; otherwise false
public abstract boolean denotesCurrent()
true
if this element denotes the current
('.') element, otherwise returns false
.
true
if this element denotes the current
element; otherwise false
public abstract boolean denotesName()
true
if this element represents a regular name
(i.e. neither root, '.' nor '..'), otherwise returns false
.
true
if this element represents a regular name;
otherwise false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |