public final class ExpressionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.expression.spel.support.SimpleEvaluationContext |
createSimpleEvaluationContext()
Used to create a context with no BeanFactory, usually in tests.
|
static org.springframework.expression.spel.support.SimpleEvaluationContext |
createSimpleEvaluationContext(org.springframework.beans.factory.BeanFactory beanFactory)
Obtains the context from the beanFactory if not null; emits a warning if the beanFactory
is null.
|
static org.springframework.expression.spel.support.StandardEvaluationContext |
createStandardEvaluationContext()
Used to create a context with no BeanFactory, usually in tests.
|
static org.springframework.expression.spel.support.StandardEvaluationContext |
createStandardEvaluationContext(org.springframework.beans.factory.BeanFactory beanFactory)
Obtains the context from the beanFactory if not null; emits a warning if the beanFactory
is null.
|
static java.io.File |
expressionToFile(org.springframework.expression.Expression expression,
org.springframework.expression.EvaluationContext evaluationContext,
org.springframework.messaging.Message<?> message,
java.lang.String name)
Evaluate an expression and return a
File object; the expression can evaluate
to a String or File. |
static org.springframework.expression.Expression |
intExpression(java.lang.String expression)
Return a
ValueExpression for a simple literal, otherwise
a SpelExpression. |
static org.springframework.expression.Expression |
longExpression(java.lang.String expression)
Return a
ValueExpression for a simple literal, otherwise
a SpelExpression. |
public static org.springframework.expression.spel.support.StandardEvaluationContext createStandardEvaluationContext()
public static org.springframework.expression.spel.support.SimpleEvaluationContext createSimpleEvaluationContext()
public static org.springframework.expression.spel.support.StandardEvaluationContext createStandardEvaluationContext(org.springframework.beans.factory.BeanFactory beanFactory)
beanFactory - The bean factory.public static org.springframework.expression.spel.support.SimpleEvaluationContext createSimpleEvaluationContext(org.springframework.beans.factory.BeanFactory beanFactory)
beanFactory - The bean factory.public static java.io.File expressionToFile(org.springframework.expression.Expression expression,
org.springframework.expression.EvaluationContext evaluationContext,
org.springframework.messaging.Message<?> message,
java.lang.String name)
File object; the expression can evaluate
to a String or File.expression - the expression.evaluationContext - the evaluation context.message - the message (if available).name - the name of the result of the evaluation.public static org.springframework.expression.Expression intExpression(java.lang.String expression)
ValueExpression for a simple literal, otherwise
a SpelExpression.expression - the expression string.public static org.springframework.expression.Expression longExpression(java.lang.String expression)
ValueExpression for a simple literal, otherwise
a SpelExpression.expression - the expression string.