Package org.apache.jackrabbit.spi
Interface PathFactory
-
- All Known Implementing Classes:
PathFactoryImpl,PathFactoryLogger
public interface PathFactoryPathFactory...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Pathcreate(String pathString)Returns aPathholding the value of the specified string.Pathcreate(Name name)Creates a relative path based on aName.Pathcreate(Name name, int index)Creates a relative path based on aNameand a normalized index.Pathcreate(Path.Element element)Creates a path from the given element.Pathcreate(Path.Element[] elements)Create a newPathfrom the given elements.Pathcreate(Path parent, Name name, boolean normalize)Creates a newPathout of the givenparentpath and the give name.Pathcreate(Path parent, Name name, int index, boolean normalize)Creates a newPathout of the givenparentpath and the give name and normalized index.Pathcreate(Path parent, Path relPath, boolean normalize)Return a newPathout of the givenparentpath and the given relative path.Path.ElementcreateElement(String identifier)Creates a path element from the givenidentifier.Path.ElementcreateElement(Name name)Creates a path element from the givenname.Path.ElementcreateElement(Name name, int index)Same ascreateElement(Name)except that an explicit index can be specified.Path.ElementgetCurrentElement()Return the current element.Path.ElementgetParentElement()Return the parent element.Path.ElementgetRootElement()Return the root element.PathgetRootPath()Return thePathof the root node.
-
-
-
Method Detail
-
create
Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, RepositoryException
Return a newPathout of the givenparentpath and the given relative path. Ifnormalizeistrue, the returned path will be normalized (or canonicalized, if the parent path is absolute).- Parameters:
parent-relPath-normalize-- Returns:
- Throws:
IllegalArgumentException- ifrelPathis absolute.RepositoryException- If thenormalizedistrueand the resulting path cannot be normalized.
-
create
Path create(Path parent, Name name, boolean normalize) throws RepositoryException
Creates a newPathout of the givenparentpath and the give name. Ifnormalizeistrue, the returned path will be normalized (or canonicalized, if the parent path is absolute). Usecreate(Path, Name, int, boolean)in order to build aPathhaving an index with his name element.- Parameters:
parent- the parent pathname- the name of the new path element.normalize- If true the Path is normalized before being returned.- Returns:
- Throws:
RepositoryException- If thenormalizedistrueand the resulting path cannot be normalized.
-
create
Path create(Path parent, Name name, int index, boolean normalize) throws IllegalArgumentException, RepositoryException
Creates a newPathout of the givenparentpath and the give name and normalized index. See alsocreate(Path, Name, boolean).- Parameters:
parent- the parent path.name- the name of the new path element.index- the index of the new path element.normalize- If true the Path is normalized before being returned.- Returns:
- Throws:
IllegalArgumentException- If the given index is lower thanPath.INDEX_UNDEFINED.RepositoryException- If thenormalizedistrueand the resulting path cannot be normalized.
-
create
Path create(Name name) throws IllegalArgumentException
Creates a relative path based on aName.- Parameters:
name- singleNamefor this relative path.- Returns:
- the relative path created from
name. - Throws:
IllegalArgumentException- if the name isnull.
-
create
Path create(Name name, int index) throws IllegalArgumentException
Creates a relative path based on aNameand a normalized index. Same ascreate(Name)but allows to explicitly specify an index.- Parameters:
name- singleNamefor this relative path.index- index of the single name element.- Returns:
- the relative path created from
nameandnormalizedIndex. - Throws:
IllegalArgumentException- ifindexis lower thanPath.INDEX_UNDEFINEDor if the name is not valid.
-
create
Path create(Path.Element element) throws IllegalArgumentException
Creates a path from the given element.- Parameters:
element- path element- Returns:
- the created path
- Throws:
IllegalArgumentException- if the given element isnull
-
create
Path create(Path.Element[] elements) throws IllegalArgumentException
Create a newPathfrom the given elements.- Parameters:
elements-- Returns:
- the
Pathcreated from the elements. - Throws:
IllegalArgumentException- If the given elements arenullor have a length of 0 or would otherwise constitute an invalid path.
-
create
Path create(String pathString) throws IllegalArgumentException
Returns aPathholding the value of the specified string. The string must be in the format returned by thePath.getString()method.- Parameters:
pathString- aStringcontaining thePathrepresentation to be parsed.- Returns:
- the
Pathrepresented by the argument - Throws:
IllegalArgumentException- if the specified string can not be parsed as aPath.- See Also:
Path.getString(),Path.DELIMITER
-
createElement
Path.Element createElement(Name name) throws IllegalArgumentException
Creates a path element from the givenname. The created path element does not contain an explicit index.If the specified name denotes a special path element (either
getParentElement(),getCurrentElement()orgetRootElement()) then the associated constant is returned.- Parameters:
name- the name of the element- Returns:
- a path element
- Throws:
IllegalArgumentException- if the name isnull
-
createElement
Path.Element createElement(Name name, int index) throws IllegalArgumentException
Same ascreateElement(Name)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
getParentElement(),getCurrentElement()orgetRootElement()) since an explicit index is not allowed in this context.- Parameters:
name- the name of the elementindex- the index if the element.- Returns:
- a path element
- Throws:
IllegalArgumentException- if the name isnull, if the given index is lower thanPath.INDEX_UNDEFINEDor if name denoting a special path element.
-
createElement
Path.Element createElement(String identifier) throws IllegalArgumentException
Creates a path element from the givenidentifier.- Parameters:
identifier- Node identifier for which the path element should be created.- Returns:
- a path element.
- Throws:
IllegalArgumentException- If theidentifierisnull.- Since:
- JCR 2.0
-
getCurrentElement
Path.Element getCurrentElement()
Return the current element.- Returns:
- the current element.
-
getParentElement
Path.Element getParentElement()
Return the parent element.- Returns:
- the parent element.
-
getRootElement
Path.Element getRootElement()
Return the root element.- Returns:
- the root element.
-
getRootPath
Path getRootPath()
Return thePathof the root node.- Returns:
- the
Pathof the root node.
-
-