Package org.apache.bval.jsr
Class ConstraintViolationImpl<T>
- java.lang.Object
-
- org.apache.bval.jsr.ConstraintViolationImpl<T>
-
- All Implemented Interfaces:
Serializable,javax.validation.ConstraintViolation<T>
public class ConstraintViolationImpl<T> extends Object implements javax.validation.ConstraintViolation<T>, Serializable
Description: Describe a constraint validation defect.
From rootBean and propertyPath, it is possible to rebuild the context of the failure- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConstraintViolationImpl(String messageTemplate, String message, T rootBean, Object leafBean, javax.validation.Path propertyPath, Object value, javax.validation.metadata.ConstraintDescriptor<?> constraintDescriptor, Class<T> rootBeanClass, ElementType elementType, Object returnValue, Object[] parameters)Create a new ConstraintViolationImpl instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)javax.validation.metadata.ConstraintDescriptor<?>getConstraintDescriptor()Object[]getExecutableParameters()ObjectgetExecutableReturnValue()ObjectgetInvalidValue()ObjectgetLeafBean()StringgetMessage()former name getInterpolatedMessage()StringgetMessageTemplate()javax.validation.PathgetPropertyPath()TgetRootBean()Class<T>getRootBeanClass()inthashCode()StringtoString()<U> Uunwrap(Class<U> type)
-
-
-
Constructor Detail
-
ConstraintViolationImpl
public ConstraintViolationImpl(String messageTemplate, String message, T rootBean, Object leafBean, javax.validation.Path propertyPath, Object value, javax.validation.metadata.ConstraintDescriptor<?> constraintDescriptor, Class<T> rootBeanClass, ElementType elementType, Object returnValue, Object[] parameters)
Create a new ConstraintViolationImpl instance.- Parameters:
messageTemplate- - message reason (raw message)message- - interpolated message (locale specific)rootBean-leafBean-propertyPath-value-constraintDescriptor-rootBeanClass-elementType-returnValue-parameters-
-
-
Method Detail
-
getMessage
public String getMessage()
former name getInterpolatedMessage()- Specified by:
getMessagein interfacejavax.validation.ConstraintViolation<T>- Returns:
- The interpolated error message for this constraint violation.
-
getMessageTemplate
public String getMessageTemplate()
- Specified by:
getMessageTemplatein interfacejavax.validation.ConstraintViolation<T>
-
getRootBean
public T getRootBean()
- Specified by:
getRootBeanin interfacejavax.validation.ConstraintViolation<T>- Returns:
- Root bean being validated
-
getRootBeanClass
public Class<T> getRootBeanClass()
- Specified by:
getRootBeanClassin interfacejavax.validation.ConstraintViolation<T>
-
getLeafBean
public Object getLeafBean()
- Specified by:
getLeafBeanin interfacejavax.validation.ConstraintViolation<T>
-
getExecutableParameters
public Object[] getExecutableParameters()
- Specified by:
getExecutableParametersin interfacejavax.validation.ConstraintViolation<T>
-
getExecutableReturnValue
public Object getExecutableReturnValue()
- Specified by:
getExecutableReturnValuein interfacejavax.validation.ConstraintViolation<T>
-
getInvalidValue
public Object getInvalidValue()
- Specified by:
getInvalidValuein interfacejavax.validation.ConstraintViolation<T>- Returns:
- The value failing to pass the constraint
-
getPropertyPath
public javax.validation.Path getPropertyPath()
- Specified by:
getPropertyPathin interfacejavax.validation.ConstraintViolation<T>- Returns:
- the property path to the value from
rootBeanNull if the value is the rootBean itself
-
getConstraintDescriptor
public javax.validation.metadata.ConstraintDescriptor<?> getConstraintDescriptor()
- Specified by:
getConstraintDescriptorin interfacejavax.validation.ConstraintViolation<T>
-
unwrap
public <U> U unwrap(Class<U> type)
- Specified by:
unwrapin interfacejavax.validation.ConstraintViolation<T>
-
-