Top Description Fields Constructors Methods
org.hibernate.validator.internal.engine

public Class MessageInterpolatorContext

extends Object
implements HibernateMessageInterpolatorContext
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext, jakarta.validation.MessageInterpolator.Context
Static Imports
org.hibernate.validator.internal.util.CollectionHelper.toImmutableMap

Implementation of the context used during message interpolation.
Authors
Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling, Guillaume Smet

Field Summary

Modifier and TypeField and Description
private final ConstraintDescriptor<?>
private final boolean
private final ExpressionLanguageFeatureLevel
private final Map<String, Object>
private static final Log
private final Map<String, Object>
private final Path
private final Class<?>
private final Object

Constructor Summary

AccessConstructor and Description
public
MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Path propertyPath, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel, boolean customViolation)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public ConstraintDescriptor<?>
public ExpressionLanguageFeatureLevel
public Map<String, Object>
public Map<String, Object>
public Path
public Class<?>
public Object
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public <T> T
unwrap(Class<T>
the class of the object to be returned
type
)

Implements jakarta.validation.MessageInterpolator.Context.unwrap.

Returns an instance of the specified type allowing access to provider-specific APIs.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

constraintDescriptorback to summary
private final ConstraintDescriptor<?> constraintDescriptor
customViolationback to summary
private final boolean customViolation
expressionLanguageFeatureLevelback to summary
private final ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel
expressionVariablesback to summary
private final Map<String, Object> expressionVariables
Annotations
@Immutable
LOGback to summary
private static final Log LOG
messageParametersback to summary
private final Map<String, Object> messageParameters
Annotations
@Immutable
propertyPathback to summary
private final Path propertyPath
rootBeanTypeback to summary
private final Class<?> rootBeanType
validatedValueback to summary
private final Object validatedValue

Constructor Detail

MessageInterpolatorContextback to summary
public MessageInterpolatorContext(ConstraintDescriptor<?> constraintDescriptor, Object validatedValue, Class<?> rootBeanType, Path propertyPath, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel, boolean customViolation)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getConstraintDescriptorback to summary
public ConstraintDescriptor<?> getConstraintDescriptor()

Implements jakarta.validation.MessageInterpolator.Context.getConstraintDescriptor.

Returns:ConstraintDescriptor<?>

Doc from jakarta.validation.MessageInterpolator.Context.getConstraintDescriptor.

ConstraintDescriptor corresponding to the constraint being validated

Annotations
@Override
getExpressionLanguageFeatureLevelback to summary
public ExpressionLanguageFeatureLevel getExpressionLanguageFeatureLevel()

Implements org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getExpressionLanguageFeatureLevel.

Returns:ExpressionLanguageFeatureLevel

Doc from org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getExpressionLanguageFeatureLevel.

the level of features enabled for the Expression Language engine

Annotations
@Override
getExpressionVariablesback to summary
public Map<String, Object> getExpressionVariables()

Implements org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getExpressionVariables.

Returns:Map<String, Object>

Doc from org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getExpressionVariables.

the expression variables added to this context for EL interpolation

Annotations
@Override
getMessageParametersback to summary
public Map<String, Object> getMessageParameters()

Implements org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getMessageParameters.

Returns:Map<String, Object>

Doc from org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getMessageParameters.

the message parameters added to this context for interpolation

Annotations
@Override
getPropertyPathback to summary
public Path getPropertyPath()

Implements org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getPropertyPath.

Returns:Path

Doc from org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getPropertyPath.

the path to the validated constraint starting from the root bean

Annotations
@Override
getRootBeanTypeback to summary
public Class<?> getRootBeanType()

Implements org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getRootBeanType.

Doc from org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext.getRootBeanType.

Returns the currently validated root bean type.

Returns:Class<?>

The currently validated root bean type.

Annotations
@Override
getValidatedValueback to summary
public Object getValidatedValue()

Implements jakarta.validation.MessageInterpolator.Context.getValidatedValue.

Returns:Object

Doc from jakarta.validation.MessageInterpolator.Context.getValidatedValue.

value being validated

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isCustomViolationback to summary
public boolean isCustomViolation()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> type)

Implements jakarta.validation.MessageInterpolator.Context.unwrap.

Doc from jakarta.validation.MessageInterpolator.Context.unwrap.

Returns 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, ValidationException is thrown.

Parameters
<T>
the type of the object to be returned
type:Class<T>

the class of the object to be returned

Returns:T

an instance of the specified class

Annotations
@Override