public class ValidationStateFailureCollector extends AbstractValidationStateCollector
ValidationState that wraps an existing ValidationState and allows to
collect the potential failures for a part of the validation process. public booleanvalidate(ValidationStatestate) { if (state == null) { state = newValidationStateImpl(); }ValidationStateFailureCollectorfailureCollector = newValidationStateFailureCollector(state); validateRecursive(failureCollector);List<ValidationFailure> childFailureList = failureCollector.getFailureList(); if (!childFailureList.isEmpty()) { applyValidationFailures(childFailureList); } return failureCollector.isValid(); }
| Modifier and Type | Field and Description |
|---|---|
private List<ValidationFailure> |
failureList |
| Constructor and Description |
|---|
ValidationStateFailureCollector(ValidationState delegate)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<ValidationFailure> |
getFailureList()
|
boolean |
isValid()
This method determines if the
validation has
been successful. |
void |
onFailure(ValidationFailure failure)
This method gets called if a
ValidationFailure occurred. |
String |
toString() |
getDelegate, getFailureCountprivate final List<ValidationFailure> failureList
onFailure(ValidationFailure)public ValidationStateFailureCollector(ValidationState delegate)
delegate - is the ValidationState to adapt.public void onFailure(ValidationFailure failure)
ValidationFailure occurred.onFailure in interface ValidationCollectoronFailure in class AbstractValidationStateCollectorfailure - is the new ValidationFailure.public boolean isValid()
validation has
been successful.
false if a ValidationFailure has been
collected by this instance. It may therefore return
true even if the delegate would return false.isValid in interface ValidationStateisValid in class AbstractValidationStateCollectortrue if no ValidationFailure has been collected, false otherwise.public List<ValidationFailure> getFailureList()
List of ValidationFailures.Copyright © 2001–2015 mmm-Team. All rights reserved.