Package org.apache.bval.jsr
Class ConstraintViolationImpl<T>
- java.lang.Object
-
- org.apache.bval.jsr.ConstraintViolationImpl<T>
-
- All Implemented Interfaces:
jakarta.validation.ConstraintViolation<T>
,Serializable
public class ConstraintViolationImpl<T> extends Object implements jakarta.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, jakarta.validation.Path propertyPath, Object value, jakarta.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 boolean
equals(Object o)
jakarta.validation.metadata.ConstraintDescriptor<?>
getConstraintDescriptor()
Object[]
getExecutableParameters()
Object
getExecutableReturnValue()
Object
getInvalidValue()
Object
getLeafBean()
String
getMessage()
former name getInterpolatedMessage()String
getMessageTemplate()
jakarta.validation.Path
getPropertyPath()
T
getRootBean()
Class<T>
getRootBeanClass()
int
hashCode()
String
toString()
<U> U
unwrap(Class<U> type)
-
-
-
Constructor Detail
-
ConstraintViolationImpl
public ConstraintViolationImpl(String messageTemplate, String message, T rootBean, Object leafBean, jakarta.validation.Path propertyPath, Object value, jakarta.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:
getMessage
in interfacejakarta.validation.ConstraintViolation<T>
- Returns:
- The interpolated error message for this constraint violation.
-
getMessageTemplate
public String getMessageTemplate()
- Specified by:
getMessageTemplate
in interfacejakarta.validation.ConstraintViolation<T>
-
getRootBean
public T getRootBean()
- Specified by:
getRootBean
in interfacejakarta.validation.ConstraintViolation<T>
- Returns:
- Root bean being validated
-
getRootBeanClass
public Class<T> getRootBeanClass()
- Specified by:
getRootBeanClass
in interfacejakarta.validation.ConstraintViolation<T>
-
getLeafBean
public Object getLeafBean()
- Specified by:
getLeafBean
in interfacejakarta.validation.ConstraintViolation<T>
-
getExecutableParameters
public Object[] getExecutableParameters()
- Specified by:
getExecutableParameters
in interfacejakarta.validation.ConstraintViolation<T>
-
getExecutableReturnValue
public Object getExecutableReturnValue()
- Specified by:
getExecutableReturnValue
in interfacejakarta.validation.ConstraintViolation<T>
-
getInvalidValue
public Object getInvalidValue()
- Specified by:
getInvalidValue
in interfacejakarta.validation.ConstraintViolation<T>
- Returns:
- The value failing to pass the constraint
-
getPropertyPath
public jakarta.validation.Path getPropertyPath()
- Specified by:
getPropertyPath
in interfacejakarta.validation.ConstraintViolation<T>
- Returns:
- the property path to the value from
rootBean
Null if the value is the rootBean itself
-
getConstraintDescriptor
public jakarta.validation.metadata.ConstraintDescriptor<?> getConstraintDescriptor()
- Specified by:
getConstraintDescriptor
in interfacejakarta.validation.ConstraintViolation<T>
-
unwrap
public <U> U unwrap(Class<U> type)
- Specified by:
unwrap
in interfacejakarta.validation.ConstraintViolation<T>
-
-