public interface PathFactory
PathFactory
...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
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.
|
Path.Element |
getParentElement()
Return the parent element.
|
Path.Element |
getRootElement()
Return the root element.
|
Path |
getRootPath()
Return the
Path of the root node. |
Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, javax.jcr.RepositoryException
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).parent
- relPath
- normalize
- IllegalArgumentException
- if relPath
is absolute.javax.jcr.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.Path create(Path parent, Name name, boolean normalize) throws javax.jcr.RepositoryException
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 create(Path, Name, int, boolean)
in order to build a Path
having an index with his name element.parent
- the parent pathname
- the name of the new path element.normalize
- If true the Path is normalized before being returned.javax.jcr.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.Path create(Path parent, Name name, int index, boolean normalize) throws IllegalArgumentException, javax.jcr.RepositoryException
Path
out of the given parent
path
and the give name and normalized index. See also
create(Path, Name, boolean)
.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
.javax.jcr.RepositoryException
- If the normalized
is
true
and the resulting path cannot be normalized.Path create(Name name) throws IllegalArgumentException
Name
.name
- single Name
for this relative path.name
.IllegalArgumentException
- if the name is null
.Path create(Name name, int index) throws IllegalArgumentException
Name
and a normalized index.
Same as create(Name)
but allows to explicitly specify an
index.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.Path create(Path.Element element) throws IllegalArgumentException
element
- path elementIllegalArgumentException
- if the given element is null
Path create(Path.Element[] elements) throws IllegalArgumentException
Path
from the given elements.elements
- 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.Path create(String pathString) throws IllegalArgumentException
Path
holding the value of the specified
string. The string must be in the format returned by the
Path.getString()
method.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
.Path.getString()
,
Path.DELIMITER
Path.Element createElement(Name name) throws IllegalArgumentException
name
.
The created path element does not contain an explicit index.
If the specified name denotes a special path element (either
getParentElement()
, getCurrentElement()
or
getRootElement()
) then the associated constant is returned.
name
- the name of the elementIllegalArgumentException
- if the name is null
Path.Element createElement(Name name, int index) throws IllegalArgumentException
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
getParentElement()
, getCurrentElement()
or
getRootElement()
) since an explicit index is not allowed
in this context.
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.Path.Element createElement(String identifier) throws IllegalArgumentException
identifier
.identifier
- Node identifier for which the path element should be created.IllegalArgumentException
- If the identifier
is null
.Path.Element getCurrentElement()
Path.Element getParentElement()
Path.Element getRootElement()
Path getRootPath()
Path
of the root node.Path
of the root node.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.