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<javax.validation.ConstraintViolation<?>> |
getAllViolations()
Returns an immutable set of all constraint violations detected.
|
BindingError |
getBindingError(String param)
Returns the binding error for the binding specified by the given
parameter name.
|
javax.validation.ConstraintViolation<?> |
getViolation(String param)
Returns a single constraint violation detected for a parameter binding
specified by the given parameter name.
|
Set<javax.validation.ConstraintViolation<?>> |
getViolations(String param)
Returns an immutable set of all constraint violations 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<javax.validation.ConstraintViolation<?>> getAllViolations()
Set<javax.validation.ConstraintViolation<?>> getViolations(String param)
param
- The parameter namegetViolation(String)
javax.validation.ConstraintViolation<?> getViolation(String param)
null
if no violation was detected.param
- The parameter namenull
getViolation(String)
Copyright © 2015 Oracle Corporation. All rights reserved.