Class SpringELExpressionParser
java.lang.Object
org.springframework.binding.expression.spel.SpringELExpressionParser
- All Implemented Interfaces:
ExpressionParser
- Direct Known Subclasses:
WebFlowSpringELExpressionParser
Adapt the Spring EL
SpelExpressionParser
to the Spring Binding
ExpressionParser
contract.- Since:
- 2.1.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionSpringELExpressionParser
(org.springframework.expression.spel.standard.SpelExpressionParser expressionParser) SpringELExpressionParser
(org.springframework.expression.spel.standard.SpelExpressionParser expressionParser, ConversionService conversionService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyAccessor
(org.springframework.expression.PropertyAccessor propertyAccessor) protected SpringELExpression
createSpringELExpression
(Map<String, Expression> expressionVars, org.springframework.expression.Expression spelExpression, Class<?> expectedResultType, org.springframework.core.convert.ConversionService conversionService) Create theSpringELExpression
.parseExpression
(String expression, ParserContext context) Parse the expression string and return a compiled Expression object you can use for evaluation.
-
Constructor Details
-
SpringELExpressionParser
public SpringELExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser expressionParser) -
SpringELExpressionParser
public SpringELExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser expressionParser, ConversionService conversionService)
-
-
Method Details
-
getConversionService
-
addPropertyAccessor
public void addPropertyAccessor(org.springframework.expression.PropertyAccessor propertyAccessor) -
parseExpression
Description copied from interface:ExpressionParser
Parse the expression string and return a compiled Expression object you can use for evaluation. Some examples:3 + 4 name.firstName
- Specified by:
parseExpression
in interfaceExpressionParser
- Parameters:
expression
- the raw expression string to parsecontext
- a context for influencing this expression parsing routine (optional)- Returns:
- an evaluator for the parsed expression
- Throws:
ParserException
- an exception occurred during parsing
-
createSpringELExpression
protected SpringELExpression createSpringELExpression(Map<String, Expression> expressionVars, org.springframework.expression.Expression spelExpression, Class<?> expectedResultType, org.springframework.core.convert.ConversionService conversionService) Create theSpringELExpression
.Note: as of 2.4.8, this method is not invoked when a
SimpleParserContext
is passed in, which is mainly the case when using SpEL for data binding. In those scenarios, the configuration options are limited to the use of property accessors and a ConversionService.
-