public class ValidationException extends RuntimeException implements Iterable<ViolationException>
ViolationException
,
PathIterator
,
Serialized FormConstructor and Description |
---|
ValidationException(List<? extends ViolationException> violations)
Constructs a new
ValidationException with the specified
list of violations. |
ValidationException(ViolationException violation)
Constructs a new
ValidationException with the specified
single violation. |
Modifier and Type | Method and Description |
---|---|
ViolationException |
getFirstViolation()
Returns first violation in the list.
|
List<ViolationException> |
getRootViolations()
Returns unmodifiable list of root violations.
|
boolean |
isCascade()
Determines if it is result of cascade validation.
|
PathIterator |
iterator()
Returns iterator over all violations hierarchy.
|
PathIterator |
iterator(NodeFormatter formatter)
Returns iterator over all violations hierarchy.
|
void |
printViolations()
Prints violations to the standard error stream.
|
void |
printViolations(PrintStream stream)
Prints violations to the specified print stream.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ValidationException(ViolationException violation)
ValidationException
with the specified
single violation.violation
- Single violation.public ValidationException(List<? extends ViolationException> violations)
ValidationException
with the specified
list of violations.violations
- List of violations.public List<ViolationException> getRootViolations()
public ViolationException getFirstViolation()
public boolean isCascade()
true
if it is result of cascade validation;
false
otherwise.public PathIterator iterator()
iterator
in interface Iterable<ViolationException>
public PathIterator iterator(NodeFormatter formatter)
formatter
- Formatter to be used for formatting violation nodes on
the path.public void printViolations()
public void printViolations(PrintStream stream)
stream
- Stream to use for output.Copyright © 2011–2020 FoxLabs. All rights reserved.