public interface BindingResult
Describes the binding result of all controller fields and controller
method parameters which are annotated with a binding annotation like
FormParam
.
A binding can fail because of type conversion issues or in case of validation errors. The former can for example happen if the binding annotation is placed on a numeric type but the value cannot be converted to that type. The latter may be caused by constraint violations detected during validation.
Controller methods which declare a parameter of this type will be executed even if the binding for fields and method parameters fails.
Modifier and Type | Method and Description |
---|---|
Set<BindingError> |
getAllBindingErrors()
Returns an immutable set of all binding errors detected while processing
parameter bindings.
|
List<String> |
getAllMessages()
Returns an immutable list of all messages representing both binding errors and
constraint violations.
|
Set<ValidationError> |
getAllValidationErrors()
Returns an immutable set of all validation errors detected.
|
BindingError |
getBindingError(String param)
Returns the binding error for the binding specified by the given
parameter name.
|
ValidationError |
getValidationError(String param)
Returns a single validation error detected for a parameter binding
specified by the given parameter name.
|
Set<ValidationError> |
getValidationErrors(String param)
Returns an immutable set of all validation errors detected
for a parameter binding specified by the given parameter name.
|
boolean |
isFailed()
Returns
true if there is at least one binding error or
constraint violation. |
boolean isFailed()
true
if there is at least one binding error or
constraint violation.true
if there is at least one binding error
constraint violation.List<String> getAllMessages()
BindingError.getMessage()
and ConstraintViolation.getMessage()
to create the individual messages.Set<BindingError> getAllBindingErrors()
BindingError getBindingError(String param)
null
if no binding error
was detected.param
- The parameter namenull
Set<ValidationError> getAllValidationErrors()
Set<ValidationError> getValidationErrors(String param)
param
- The parameter namegetValidationError(String)
ValidationError getValidationError(String param)
null
if no error was detected.param
- The parameter namenull
getValidationErrors(String)
Copyright © 2017 Ivar Grimstad. All rights reserved.