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

public Class ElTermResolver

extends Object
implements TermResolver
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.internal.engine.messageinterpolation.TermResolver
Imports
java.lang.invoke.MethodHandles, java.util.Locale, .Map, org.hibernate.validator.internal.engine.messageinterpolation.el.BeanMethodsELContext, .BeanPropertiesElContext, .DisabledFeatureELException, .RootResolver, .VariablesELContext, org.hibernate.validator.internal.util.logging.Log, .LoggerFactory, org.hibernate.validator.messageinterpolation.HibernateMessageInterpolatorContext, jakarta.el.ELContext, .ELException, .ExpressionFactory, .MethodNotFoundException, .PropertyNotFoundException, .ValueExpression, jakarta.validation.MessageInterpolator

Resolver for the el expressions.
Authors
Hardy Ferentschik, Adam Stawicki, Guillaume Smet

Field Summary

Modifier and TypeField and Description
private final ExpressionFactory
expressionFactory

Factory for creating EL expressions

private final Locale
locale

The locale for which to interpolate the expression.

private static final Log
private static final String
VALIDATED_VALUE_NAME

Name under which the currently validate value is bound to the EL context.

Constructor Summary

AccessConstructor and Description
public
ElTermResolver(Locale
the locale.
locale
,
ExpressionFactory
the expression factory.
expressionFactory
)

Construct the resolver.

Method Summary

Modifier and TypeMethod and Description
private void
private ValueExpression
bindContextValues(String messageTemplate, MessageInterpolator.Context messageInterpolatorContext, ELContext elContext)

private ELContext
public String
interpolate(MessageInterpolator.Context
contextual information related to the interpolation
context
,
String
the message to interpolate
expression
)

Implements org.hibernate.validator.internal.engine.messageinterpolation.TermResolver.interpolate.

Interpolates given term based on the constraint validation context.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expressionFactoryback to summary
private final ExpressionFactory expressionFactory

Factory for creating EL expressions

localeback to summary
private final Locale locale

The locale for which to interpolate the expression.

LOGback to summary
private static final Log LOG
VALIDATED_VALUE_NAMEback to summary
private static final String VALIDATED_VALUE_NAME

Name under which the currently validate value is bound to the EL context.

Constructor Detail

ElTermResolverback to summary
public ElTermResolver(Locale locale, ExpressionFactory expressionFactory)

Construct the resolver. The expression factory has to be passed in to ensure that it is set up early and to allow for application control.

Parameters
locale:Locale

the locale.

expressionFactory:ExpressionFactory

the expression factory.

Method Detail

addVariablesToElContextback to summary
private void addVariablesToElContext(ELContext elContext, Map<String, Object> variables)
bindContextValuesback to summary
private ValueExpression bindContextValues(String messageTemplate, MessageInterpolator.Context messageInterpolatorContext, ELContext elContext)
getElContextback to summary
private ELContext getElContext(MessageInterpolator.Context context)
interpolateback to summary
public String interpolate(MessageInterpolator.Context context, String expression)

Implements org.hibernate.validator.internal.engine.messageinterpolation.TermResolver.interpolate.

Doc from org.hibernate.validator.internal.engine.messageinterpolation.TermResolver.interpolate.

Interpolates given term based on the constraint validation context.

Parameters
context:MessageInterpolator.Context

contextual information related to the interpolation

expression:String

the message to interpolate

Returns:String

interpolated message

Annotations
@Override