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.
 java.lang.Object getInvalidValue()
           
 java.lang.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
 java.lang.String getMessage()
           
 java.lang.String getMessageTemplate()
           
 Path getPropertyPath()
           
 T getRootBean()
           
 java.lang.Class<T> getRootBeanClass()
           
 

Method Detail

getMessage

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

getMessageTemplate

java.lang.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

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

getLeafBean

java.lang.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

java.lang.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


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not change the content in any way.