public class PathFactoryImpl extends Object implements PathFactory
PathFactoryImpl
...Modifier and Type | Method and Description |
---|---|
Path |
create(Name name)
Creates a relative path based on a
Name . |
Path |
create(Name name,
int index)
Creates a relative path based on a
Name and a normalized index. |
Path |
create(Path.Element element)
Creates a path from the given element.
|
Path |
create(Path.Element[] elements)
Create a new
Path from the given elements. |
Path |
create(Path parent,
Name name,
boolean normalize)
Creates a new
Path out of the given parent path
and the give name. |
Path |
create(Path parent,
Name name,
int index,
boolean normalize)
Creates a new
Path out of the given parent path
and the give name and normalized index. |
Path |
create(Path parent,
Path relPath,
boolean normalize)
Return a new
Path out of the given parent path
and the given relative path. |
Path |
create(String pathString)
Returns a
Path holding the value of the specified
string. |
Path.Element |
createElement(Name name)
Creates a path element from the given
name . |
Path.Element |
createElement(Name name,
int index)
Same as
PathFactory.createElement(Name) except that an explicit index can be
specified. |
Path.Element |
createElement(String identifier)
Creates a path element from the given
identifier . |
Path.Element |
getCurrentElement()
Return the current element.
|
static PathFactory |
getInstance() |
Path.Element |
getParentElement()
Return the parent element.
|
Path.Element |
getRootElement()
Return the root element.
|
Path |
getRootPath()
Return the
Path of the root node. |
public static PathFactory getInstance()
public Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, RepositoryException
PathFactory
Path
out of the given parent
path
and the given relative path. If normalize
is
true
, the returned path will be normalized (or
canonicalized, if the parent path is absolute).create
in interface PathFactory
IllegalArgumentException
- if relPath
is absolute.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.PathFactory.create(Path, Path, boolean)
public Path create(Path parent, Name name, boolean normalize) throws RepositoryException
PathFactory
Path
out of the given parent
path
and the give name. If normalize
is true
,
the returned path will be normalized (or canonicalized, if the parent
path is absolute). Use PathFactory.create(Path, Name, int, boolean)
in order to build a Path
having an index with his name element.create
in interface PathFactory
parent
- the parent pathname
- the name of the new path element.normalize
- If true the Path is normalized before being returned.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.PathFactory.create(Path, Name, boolean)
public Path create(Path parent, Name name, int index, boolean normalize) throws IllegalArgumentException, RepositoryException
PathFactory
Path
out of the given parent
path
and the give name and normalized index. See also
PathFactory.create(Path, Name, boolean)
.create
in interface PathFactory
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.IllegalArgumentException
- If the given index is lower than
Path.INDEX_UNDEFINED
.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.PathFactory.create(Path, Name, int, boolean)
public Path create(Name name) throws IllegalArgumentException
PathFactory
Name
.create
in interface PathFactory
name
- single Name
for this relative path.name
.IllegalArgumentException
- if the name is null
.PathFactory.create(Name)
public Path create(Name name, int index) throws IllegalArgumentException
PathFactory
Name
and a normalized index.
Same as PathFactory.create(Name)
but allows to explicitly specify an
index.create
in interface PathFactory
name
- single Name
for this relative path.index
- index of the single name element.name
and normalizedIndex
.IllegalArgumentException
- if index
is lower
than Path.INDEX_UNDEFINED
or if the name is not valid.PathFactory.create(Name, int)
public Path create(Path.Element element)
PathFactory
create
in interface PathFactory
element
- path elementpublic Path create(Path.Element[] elements) throws IllegalArgumentException
PathFactory
Path
from the given elements.create
in interface PathFactory
Path
created from the elements.IllegalArgumentException
- If the given elements are null
or have a length of 0 or would otherwise constitute an invalid path.PathFactory.create(org.apache.jackrabbit.spi.Path.Element[])
public Path create(String pathString) throws IllegalArgumentException
PathFactory
Path
holding the value of the specified
string. The string must be in the format returned by the
Path.getString()
method.create
in interface PathFactory
pathString
- a String
containing the Path
representation to be parsed.Path
represented by the argumentIllegalArgumentException
- if the specified string can not be parsed
as a Path
.PathFactory.create(String)
public Path.Element createElement(Name name) throws IllegalArgumentException
PathFactory
name
.
The created path element does not contain an explicit index.
If the specified name denotes a special path element (either
PathFactory.getParentElement()
, PathFactory.getCurrentElement()
or
PathFactory.getRootElement()
) then the associated constant is returned.
createElement
in interface PathFactory
name
- the name of the elementIllegalArgumentException
- if the name is null
PathFactory.createElement(Name)
public Path.Element createElement(Name name, int index) throws IllegalArgumentException
PathFactory
PathFactory.createElement(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
PathFactory.getParentElement()
, PathFactory.getCurrentElement()
or
PathFactory.getRootElement()
) since an explicit index is not allowed
in this context.
createElement
in interface PathFactory
name
- the name of the elementindex
- the index if the element.IllegalArgumentException
- if the name is null
,
if the given index is lower than Path.INDEX_UNDEFINED
or if name
denoting a special path element.PathFactory.createElement(Name, int)
public Path.Element createElement(String identifier) throws IllegalArgumentException
PathFactory
identifier
.createElement
in interface PathFactory
identifier
- Node identifier for which the path element should be created.IllegalArgumentException
- If the identifier
is null
.public Path.Element getCurrentElement()
PathFactory
getCurrentElement
in interface PathFactory
PathFactory.getCurrentElement()
public Path.Element getParentElement()
PathFactory
getParentElement
in interface PathFactory
PathFactory.getParentElement()
public Path.Element getRootElement()
PathFactory
getRootElement
in interface PathFactory
PathFactory.getRootElement()
public Path getRootPath()
PathFactory
Path
of the root node.getRootPath
in interface PathFactory
Path
of the root node.PathFactory.getRootPath()
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.