public interface PathContainer
Separator
and PathSegment
elements.
An instance of this class can be created via parsePath(String)
.
Each PathSegment
exposes its structure decoded
safely without the risk of encoded reserved characters altering the path or
segment structure and without path parameters for path matching purposes.
Modifier and Type | Interface and Description |
---|---|
static interface |
PathContainer.Element
Common representation of a path element, e.g.
|
static interface |
PathContainer.PathSegment
Path segment element.
|
static interface |
PathContainer.Separator
Path separator element.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<PathContainer.Element> |
elements()
The list of path elements, either
PathContainer.Separator or PathContainer.PathSegment . |
static PathContainer |
parsePath(java.lang.String path)
Parse the path value into a sequence of
Separator and
PathSegment elements. |
default PathContainer |
subPath(int index)
Extract a sub-path from the given offset into the elements list.
|
default PathContainer |
subPath(int startIndex,
int endIndex)
Extract a sub-path from the given start offset (inclusive) into the
element list and to the end offset (exclusive).
|
java.lang.String |
value()
The original path that was parsed.
|
java.lang.String value()
java.util.List<PathContainer.Element> elements()
PathContainer.Separator
or PathContainer.PathSegment
.default PathContainer subPath(int index)
index
- the start element index (inclusive)default PathContainer subPath(int startIndex, int endIndex)
startIndex
- the start element index (inclusive)endIndex
- the end element index (exclusive)static PathContainer parsePath(java.lang.String path)
Separator
and
PathSegment
elements.path
- the encoded, raw URL path value to parse