Class SpringELExpressionParser

java.lang.Object
org.springframework.binding.expression.spel.SpringELExpressionParser
All Implemented Interfaces:
ExpressionParser
Direct Known Subclasses:
WebFlowSpringELExpressionParser

public class SpringELExpressionParser extends Object implements ExpressionParser
Adapt the Spring EL SpelExpressionParser to the Spring Binding ExpressionParser contract.
Since:
2.1.0
Author:
Rossen Stoyanchev
  • 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

      public ConversionService getConversionService()
    • addPropertyAccessor

      public void addPropertyAccessor(org.springframework.expression.PropertyAccessor propertyAccessor)
    • parseExpression

      public Expression parseExpression(String expression, ParserContext context) throws ParserException
      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 interface ExpressionParser
      Parameters:
      expression - the raw expression string to parse
      context - 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 the SpringELExpression.

      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.