public final class PathIterator extends Object implements Iterator<ViolationException>
ValidationException
to iterate over all
violations hierarchy and allows to obtain path of the current violation.NodeFormatter
,
ValidationException.iterator()
,
ValidationException.iterator(NodeFormatter)
Constructor and Description |
---|
PathIterator(ValidationException violations,
NodeFormatter formatter)
Constructs a new
PathIterator with the specified violations
hierarhy and path separator. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Determines if the iteration has more elements.
|
ViolationException |
next()
Returns next violation in the hierarhy.
|
ViolationException[] |
nodes()
Returns array of violation nodes of the current path.
|
String |
path()
Returns path of the current violation.
|
void |
remove()
Unsupported operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public PathIterator(ValidationException violations, NodeFormatter formatter)
PathIterator
with the specified violations
hierarhy and path separator.violations
- Violations hierarchy.formatter
- Formatter to be used for formatting violation nodes on
the path.public boolean hasNext()
hasNext
in interface Iterator<ViolationException>
true
if the iteration has more elements;
false
otherwise.public ViolationException next()
next
in interface Iterator<ViolationException>
public ViolationException[] nodes()
public String path()
public void remove()
remove
in interface Iterator<ViolationException>
Copyright © 2011–2020 FoxLabs. All rights reserved.