Class MessageInterpolatorContext
- java.lang.Object
-
- org.hibernate.validator.internal.engine.MessageInterpolatorContext
-
- All Implemented Interfaces:
MessageInterpolator.Context,HibernateMessageInterpolatorContext
public class MessageInterpolatorContext extends Object implements HibernateMessageInterpolatorContext
Implementation of the context used during message interpolation.- Author:
- Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling, Guillaume Smet
-
-
Constructor Summary
Constructors Constructor Description MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Path propertyPath, Map<String,Object> messageParameters, Map<String,Object> expressionVariables, ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel, boolean customViolation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ConstraintDescriptor<?>getConstraintDescriptor()ExpressionLanguageFeatureLevelgetExpressionLanguageFeatureLevel()Map<String,Object>getExpressionVariables()Map<String,Object>getMessageParameters()PathgetPropertyPath()Class<?>getRootBeanType()Returns the currently validated root bean type.ObjectgetValidatedValue()inthashCode()booleanisCustomViolation()StringtoString()<T> Tunwrap(Class<T> type)Returns an instance of the specified type allowing access to provider-specific APIs.
-
-
-
Constructor Detail
-
MessageInterpolatorContext
public MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Path propertyPath, Map<String,Object> messageParameters, Map<String,Object> expressionVariables, ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel, boolean customViolation)
-
-
Method Detail
-
getConstraintDescriptor
public ConstraintDescriptor<?> getConstraintDescriptor()
- Specified by:
getConstraintDescriptorin interfaceMessageInterpolator.Context- Returns:
ConstraintDescriptorcorresponding to the constraint being validated
-
getValidatedValue
public Object getValidatedValue()
- Specified by:
getValidatedValuein interfaceMessageInterpolator.Context- Returns:
- value being validated
-
getRootBeanType
public Class<?> getRootBeanType()
Description copied from interface:HibernateMessageInterpolatorContextReturns the currently validated root bean type.- Specified by:
getRootBeanTypein interfaceHibernateMessageInterpolatorContext- Returns:
- The currently validated root bean type.
-
getMessageParameters
public Map<String,Object> getMessageParameters()
- Specified by:
getMessageParametersin interfaceHibernateMessageInterpolatorContext- Returns:
- the message parameters added to this context for interpolation
-
getExpressionLanguageFeatureLevel
public ExpressionLanguageFeatureLevel getExpressionLanguageFeatureLevel()
- Specified by:
getExpressionLanguageFeatureLevelin interfaceHibernateMessageInterpolatorContext- Returns:
- the level of features enabled for the Expression Language engine
-
isCustomViolation
public boolean isCustomViolation()
-
getExpressionVariables
public Map<String,Object> getExpressionVariables()
- Specified by:
getExpressionVariablesin interfaceHibernateMessageInterpolatorContext- Returns:
- the expression variables added to this context for EL interpolation
-
getPropertyPath
public Path getPropertyPath()
- Specified by:
getPropertyPathin interfaceHibernateMessageInterpolatorContext- Returns:
- the path to the validated constraint starting from the root bean
-
unwrap
public <T> T unwrap(Class<T> type)
Description copied from interface:MessageInterpolator.ContextReturns an instance of the specified type allowing access to provider-specific APIs. If the Jakarta Bean Validation provider implementation does not support the specified class,ValidationExceptionis thrown.- Specified by:
unwrapin interfaceMessageInterpolator.Context- Type Parameters:
T- the type of the object to be returned- Parameters:
type- the class of the object to be returned- Returns:
- an instance of the specified class
-
-