|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConstraintViolation<T>
Describes a constraint violation. This object exposes the constraint violation context as well as the message describing the violation.
| Method Summary | ||
|---|---|---|
ConstraintDescriptor<?> |
getConstraintDescriptor()
Returns the constraint metadata reported to fail. |
|
Object[] |
getExecutableParameters()
Returns an Object[] representing the constructor or method invocation
arguments if the ConstraintViolation is returned after validating the
method or constructor parameters. |
|
Object |
getExecutableReturnValue()
Returns the return value of the constructor or method invocation if the ConstraintViolation is returned after validating the method
or constructor return value. |
|
Object |
getInvalidValue()
Returns the value failing to pass the constraint. |
|
Object |
getLeafBean()
Returns: the bean instance the constraint is applied on if it is a bean constraint the bean instance hosting the property the constraint is applied on if it is a property constraint null when the ConstraintViolation is returned
after calling Validator.validateValue(Class, String, Object, Class[])
the object the method is executed on if it is
a method parameter, cross-parameter or return value constraint
null if it is a constructor parameter or
cross-parameter constraint
the object the constructor has created if it is a
constructor return value constraint
|
|
String |
getMessage()
|
|
String |
getMessageTemplate()
|
|
Path |
getPropertyPath()
|
|
T |
getRootBean()
Returns the root bean being validated. |
|
Class<T> |
getRootBeanClass()
Returns the class of the root bean being validated. |
|
|
unwrap(Class<U> type)
Returns an instance of the specified type allowing access to provider-specific APIs. |
|
| Method Detail |
|---|
String getMessage()
String getMessageTemplate()
T getRootBean()
null when:
ConstraintViolation is returned after calling
Validator.validateValue(Class, String, Object, Class[])ConstraintViolation is returned after validating a
constructor.
nullClass<T> getRootBeanClass()
Object getLeafBean()
null when the ConstraintViolation is returned
after calling Validator.validateValue(Class, String, Object, Class[])
null if it is a constructor parameter or
cross-parameter constraint
Object[] getExecutableParameters()
Object[] representing the constructor or method invocation
arguments if the ConstraintViolation is returned after validating the
method or constructor parameters.
Returns null otherwise.
nullObject getExecutableReturnValue()
ConstraintViolation is returned after validating the method
or constructor return value.
Returns null if the method has no return value.
Returns null otherwise.
nullPath getPropertyPath()
rootBeanObject getInvalidValue()
Object[] representing
the method invocation arguments is returned.
ConstraintDescriptor<?> getConstraintDescriptor()
<U> U unwrap(Class<U> type)
ValidationException is thrown.
type - the class of the object to be returned
ValidationException - if the provider does not support the call
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||