Package com.onec.validation
Class ValidationErrors
java.lang.Object
com.onec.validation.ValidationErrors
Accumulates validation failures across all sources (declarative attribute constraints, custom
BusinessRules) so the user sees every problem at once rather than one at a
time. throwIfAny() raises a ValidationException when anything was collected.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRecord a message on a field; a null/blank field falls back to a form-level message.voidRecord a cross-field / form-level message.booleanisEmpty()voidThrow aValidationExceptioncarrying everything collected, if non-empty.
-
Constructor Details
-
ValidationErrors
public ValidationErrors()
-
-
Method Details
-
field
Record a message on a field; a null/blank field falls back to a form-level message. -
form
Record a cross-field / form-level message. -
isEmpty
public boolean isEmpty() -
throwIfAny
public void throwIfAny()Throw aValidationExceptioncarrying everything collected, if non-empty.
-