|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.spi.commons.name.PathBuilder
public final class PathBuilder
Helper class used to build a path from pre-parsed path elements.
Note that this class does neither validate the format of the path elements nor does it validate the format of the entire path. This class should therefore only be used in situations, where the elements and the resulting path are known to be valid. The regular way of creating aPath
object is by calling any of the
PathFactory.create()
methods.
Constructor Summary | |
---|---|
PathBuilder()
Creates a new PathBuilder to create a Path using the default PathFactory . |
|
PathBuilder(Path.Element[] elements)
Creates a new PathBuilder and initialized it with the given path elements. |
|
PathBuilder(Path parent)
Creates a new PathBuilder and initialized it with elements of the given path. |
|
PathBuilder(PathFactory factory)
Creates a new PathBuilder. |
Method Summary | |
---|---|
void |
addAll(Path.Element[] elements)
Adds the given elemenets |
void |
addFirst(Name name)
Inserts the element at the beginning of the path to be built. |
void |
addFirst(Name name,
int index)
Inserts the element at the beginning of the path to be built. |
void |
addFirst(Path.Element elem)
Inserts the element at the beginning of the path to be built. |
void |
addLast(Name name)
Inserts the element at the end of the path to be built. |
void |
addLast(Name name,
int index)
Inserts the element at the end of the path to be built. |
void |
addLast(Path.Element elem)
Inserts the element at the end of the path to be built. |
void |
addRoot()
Adds the PathFactory.getRootElement() . |
Path |
getPath()
Assembles the built path and returns a new Path . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathBuilder()
default PathFactory
. See
PathBuilder(PathFactory)
for a constructor explicitely
specifying the factory to use.
public PathBuilder(PathFactory factory)
factory
- The PathFactory used to create the elements and the final path.public PathBuilder(Path.Element[] elements)
elements
- public PathBuilder(Path parent)
parent
- Method Detail |
---|
public void addRoot()
PathFactory.getRootElement()
.
public void addAll(Path.Element[] elements)
elements
- public void addFirst(Path.Element elem)
elem
- public void addFirst(Name name)
name
- public void addFirst(Name name, int index)
name
- index
- public void addLast(Path.Element elem)
elem
- public void addLast(Name name)
name
- public void addLast(Name name, int index)
name
- index
- public Path getPath() throws MalformedPathException
Path
.
Path
MalformedPathException
- if the internal path element queue is empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |