Class AbstractExpressionParser

java.lang.Object
org.springframework.binding.expression.support.AbstractExpressionParser
All Implemented Interfaces:
ExpressionParser
Direct Known Subclasses:
BeanWrapperExpressionParser

public abstract class AbstractExpressionParser extends Object implements ExpressionParser
Abstract base class for parsing ${...} style expressions.
Author:
Keith Donald
See Also:
  • Constructor Details

    • AbstractExpressionParser

      public AbstractExpressionParser()
  • Method Details

    • getExpressionPrefix

      public String getExpressionPrefix()
      Returns the configured expression delimiter prefix. Defaults to "${".
    • setExpressionPrefix

      public void setExpressionPrefix(String expressionPrefix)
      Sets the expression delimiter prefix.
    • getExpressionSuffix

      public String getExpressionSuffix()
      Returns the expression delimiter suffix. Defaults to "}".
    • setExpressionSuffix

      public void setExpressionSuffix(String expressionSuffix)
      Sets the expression delimiter suffix.
    • getAllowDelimitedEvalExpressions

      public boolean getAllowDelimitedEvalExpressions()
      Returns if this parser allows delimited eval expressions like ${foo.bar}.
    • setAllowDelimitedEvalExpressions

      public void setAllowDelimitedEvalExpressions(boolean allowDelmitedEvalExpressions)
      Sets if this parser allows eval expressions like ${foo.bar}.
    • parseExpression

      public Expression parseExpression(String expressionString, 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:
      expressionString - 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
    • parseVariableExpressions

      protected Map<String,Expression> parseVariableExpressions(ExpressionVariable[] variables) throws ParserException
      Throws:
      ParserException
    • doParseExpression

      protected abstract Expression doParseExpression(String expressionString, ParserContext context) throws ParserException
      Throws:
      ParserException