Package su.onno.validation
Class ValidationErrors
java.lang.Object
su.onno.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.Everything collected per field so far, for callers that report without throwing.voidRecord a cross-field / form-level message.Every form-level message collected so far, for callers that report without throwing.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() -
fieldErrors
Everything collected per field so far, for callers that report without throwing. -
formErrors
Every form-level message collected so far, for callers that report without throwing. -
throwIfAny
public void throwIfAny()Throw aValidationExceptioncarrying everything collected, if non-empty.
-