Modifier and Type | Class and Description |
---|---|
static class |
PathComponentExtractor.ConsumptionLimit |
Constructor and Description |
---|
PathComponentExtractor() |
Modifier and Type | Method and Description |
---|---|
void |
append(String pathPart)
Append a string to the path for later consumption through
next(ConsumptionLimit) . |
void |
appendRelativePart(String otherPath)
Append to the path the part of
otherPath that is relative to the current path. |
PathComponentExtractor |
clone() |
void |
flushTo(PathComponentExtractor.ConsumptionLimit consumeLimit)
Consume all components in the current path up to the given limit.
|
String |
getLastComponentAbsolutePath() |
String |
next(PathComponentExtractor.ConsumptionLimit consumeLimit)
Consume one more component in the current path (provided it's not beyond the given limit) and returns this component.
|
void |
reset() |
String |
toString() |
public void append(String pathPart)
next(ConsumptionLimit)
.pathPart
- A string that may or may not include path component
separators (dots).public void appendRelativePart(String otherPath) throws ParentPathMismatchException
otherPath
that is relative to the current path.
In other words, replace the current path with otherPath
provided otherPath
denotes a child element of the current path, while preserving the memory of the previously
consumed path components.
otherPath
- A path that must start with the current path.ParentPathMismatchException
- If otherPath
is not contained with the current path.public String next(PathComponentExtractor.ConsumptionLimit consumeLimit)
If this method reaches a incompletely qualified path component, i.e one that is not
followed by a dot but by the end of the path, it will return it only if consumptionLimit
is PathComponentExtractor.ConsumptionLimit.LAST
.
consumeLimit
- The consumption limit, i.e. the definition of the last component
to consume in the path.null
if the consumption limit has been reached.public void flushTo(PathComponentExtractor.ConsumptionLimit consumeLimit)
This is equivalent to calling next(consumeLimit)
repeatedly until null
is returned.
consumeLimit
- The consumption limit, i.e. the definition of the last component
to consume in the path.public void reset()
public String getLastComponentAbsolutePath()
next(ConsumptionLimit)
,
or null
if next(ConsumptionLimit)
hasn't returned such a component yet.public PathComponentExtractor clone()
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved