public final class ExpressionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static SimpleEvaluationContext |
createSimpleEvaluationContext()
Used to create a context with no BeanFactory, usually in tests.
|
static SimpleEvaluationContext |
createSimpleEvaluationContext(BeanFactory beanFactory)
Obtains the context from the beanFactory if not null; emits a warning if the beanFactory
is null.
|
static StandardEvaluationContext |
createStandardEvaluationContext()
Used to create a context with no BeanFactory, usually in tests.
|
static StandardEvaluationContext |
createStandardEvaluationContext(BeanFactory beanFactory)
Obtains the context from the beanFactory if not null; emits a warning if the beanFactory
is null.
|
static File |
expressionToFile(Expression expression,
EvaluationContext evaluationContext,
Message<?> message,
String propertyName)
|
static Expression |
intExpression(String expression)
Return a
ValueExpression for a simple literal, otherwise
a SpelExpression . |
static Expression |
longExpression(String expression)
Return a
ValueExpression for a simple literal, otherwise
a SpelExpression . |
public static StandardEvaluationContext createStandardEvaluationContext()
public static SimpleEvaluationContext createSimpleEvaluationContext()
public static StandardEvaluationContext createStandardEvaluationContext(@Nullable BeanFactory beanFactory)
beanFactory
- The bean factory.public static SimpleEvaluationContext createSimpleEvaluationContext(@Nullable BeanFactory beanFactory)
beanFactory
- The bean factory.public static File expressionToFile(Expression expression, EvaluationContext evaluationContext, @Nullable Message<?> message, String propertyName)
expression
- the expression.evaluationContext
- the evaluation context.message
- the message (if available).propertyName
- the property name the expression is evaluated for.public static Expression intExpression(String expression)
ValueExpression
for a simple literal, otherwise
a SpelExpression
.expression
- the expression string.public static Expression longExpression(String expression)
ValueExpression
for a simple literal, otherwise
a SpelExpression
.expression
- the expression string.