public class SpelMessageInterpolator extends java.lang.Object implements MessageInterpolator
MessageInterpolator that uses the Spring Expression Language (SpEL)
to evaluate expressions inside a template message.
SpEL expressions are delimited by #{} and {@code }. The provided variables are accessible
directly by name.
| Constructor and Description |
|---|
SpelMessageInterpolator()
Creates a new instance with
StandardEvaluationContext including
ReflectivePropertyAccessor and MapAccessor. |
SpelMessageInterpolator(org.springframework.expression.EvaluationContext evalContext)
Creates a new instance with a custom
EvaluationContext. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
interpolate(java.lang.String template,
java.util.Map<java.lang.String,java.lang.Object> variables)
Interpolates the message template using the given variables.
|
public SpelMessageInterpolator(org.springframework.expression.EvaluationContext evalContext)
EvaluationContext.evalContext - evalContextpublic SpelMessageInterpolator()
StandardEvaluationContext including
ReflectivePropertyAccessor and MapAccessor.public java.lang.String interpolate(java.lang.String template,
java.util.Map<java.lang.String,java.lang.Object> variables)
MessageInterpolatorinterpolate in interface MessageInterpolatortemplate - The message to interpolate.variables - Map of variables that will be accessible for the template.