org.apache.jackrabbit.name
Class Path.PathBuilder

java.lang.Object
  extended byorg.apache.jackrabbit.name.Path.PathBuilder
All Implemented Interfaces:
Cloneable
Enclosing class:
Path

public static final class Path.PathBuilder
extends Object
implements Cloneable

Internal helper class used to build a path from pre-parsed path elements.

Warning! 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 special situations. The regular way of creating/building a Path object is by calling any of the overloaded Path.create() factory methods.


Constructor Summary
Path.PathBuilder()
          Creates a new PathBuilder.
Path.PathBuilder(Path.PathElement[] elements)
          Creates a new PathBuilder and initialized it with the given path elements.
 
Method Summary
 void addAll(Path.PathElement[] elements)
          Adds the given elemenets
 void addFirst(Path.PathElement elem)
          Inserts the element at the beginning of the path to be built.
 void addFirst(QName name)
          Inserts the element at the beginning of the path to be built.
 void addFirst(QName name, int index)
          Inserts the element at the beginning of the path to be built.
 void addLast(Path.PathElement elem)
          Inserts the element at the end of the path to be built.
 void addLast(QName name)
          Inserts the element at the end of the path to be built.
 void addLast(QName name, int index)
          Inserts the element at the end of the path to be built.
 void addRoot()
          Adds the Path#ROOT_ELEMENT.
 Object clone()
           
 Path getPath()
          Assembles the built path and returns a new Path.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Path.PathBuilder

public Path.PathBuilder()
Creates a new PathBuilder.


Path.PathBuilder

public Path.PathBuilder(Path.PathElement[] elements)
Creates a new PathBuilder and initialized it with the given path elements.

Parameters:
elements -
Method Detail

addRoot

public void addRoot()
Adds the Path#ROOT_ELEMENT.


addAll

public void addAll(Path.PathElement[] elements)
Adds the given elemenets

Parameters:
elements -

addFirst

public void addFirst(Path.PathElement elem)
Inserts the element at the beginning of the path to be built.

Parameters:
elem -

addFirst

public void addFirst(QName name)
Inserts the element at the beginning of the path to be built.

Parameters:
name -

addFirst

public void addFirst(QName name,
                     int index)
Inserts the element at the beginning of the path to be built.

Parameters:
name -
index -

addLast

public void addLast(Path.PathElement elem)
Inserts the element at the end of the path to be built.

Parameters:
elem -

addLast

public void addLast(QName name)
Inserts the element at the end of the path to be built.

Parameters:
name -

addLast

public void addLast(QName name,
                    int index)
Inserts the element at the end of the path to be built.

Parameters:
name -
index -

getPath

public Path getPath()
             throws MalformedPathException
Assembles the built path and returns a new Path.

Returns:
a new Path
Throws:
MalformedPathException - if the internal path element queue is empty.

clone

public Object clone()


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.