javax.validation
Interface ConstraintViolation<T>


public interface ConstraintViolation<T>

Describe a constraint violation. This object exposes the constraint violation context as well as the message describing the violation.

Author:
Emmanuel Bernard

Method Summary
 ConstraintDescriptor<?> getConstraintDescriptor()
          Constraint metadata reported to fail.
 Object getInvalidValue()
           
 Object getLeafBean()
          If a bean constraint, the bean instance the constraint is applied on If a property constraint, the bean instance hosting the property the constraint is applied on
 String getMessage()
           
 String getMessageTemplate()
           
 Path getPropertyPath()
           
 T getRootBean()
           
 Class<T> getRootBeanClass()
           
 

Method Detail

getMessage

String getMessage()
Returns:
The interpolated error message for this constraint violation.

getMessageTemplate

String getMessageTemplate()
Returns:
The non-interpolated error message for this constraint violation.

getRootBean

T getRootBean()
Returns:
The root bean being validated. Null when returned by Validator.validateValue(Class, String, Object, Class[])

getRootBeanClass

Class<T> getRootBeanClass()
Returns:
The class of the root bean being validated

getLeafBean

Object getLeafBean()
If a bean constraint, the bean instance the constraint is applied on If a property constraint, the bean instance hosting the property the constraint is applied on

Returns:
the leaf bean the constraint is applied on. Null when returned by Validator.validateValue(Class, String, Object, Class[])

getPropertyPath

Path getPropertyPath()
Returns:
the property path to the value from rootBean.

getInvalidValue

Object getInvalidValue()
Returns:
the value failing to pass the constraint.

getConstraintDescriptor

ConstraintDescriptor<?> getConstraintDescriptor()
Constraint metadata reported to fail. The returned instance is immutable.

Returns:
constraint metadata


Copyright © 2007-2012. All Rights Reserved.