Class TemplateAwareExpressionParser
java.lang.Object
org.springframework.expression.common.TemplateAwareExpressionParser
- All Implemented Interfaces:
ExpressionParser
- Direct Known Subclasses:
SpelExpressionParser
Abstract base class for expression parsers that
support templates.
Can be subclassed by expression parsers that offer first class support for templating.
- Since:
- 3.0
- Author:
- Keith Donald, Juergen Hoeller, Andy Clement, Sam Brannen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Expression
doParseExpression
(String expressionString, ParserContext context) Actually parse the expression string and return an Expression object.parseExpression
(String expressionString) Parse the expression string and return anExpression
object that can be used for repeated evaluation.parseExpression
(String expressionString, ParserContext context) Parse the expression string and return anExpression
object that can be used for repeated evaluation.
-
Constructor Details
-
TemplateAwareExpressionParser
public TemplateAwareExpressionParser()
-
-
Method Details
-
parseExpression
Description copied from interface:ExpressionParser
Parse the expression string and return anExpression
object that can be used for repeated evaluation.Examples:
3 + 4 name.firstName
- Specified by:
parseExpression
in interfaceExpressionParser
- Parameters:
expressionString
- the raw expression string to parse- Returns:
- an
Expression
for the parsed expression - Throws:
ParseException
- if an exception occurred during parsing
-
parseExpression
public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException Description copied from interface:ExpressionParser
Parse the expression string and return anExpression
object that can be used for repeated evaluation.Examples:
3 + 4 name.firstName
- Specified by:
parseExpression
in interfaceExpressionParser
- Parameters:
expressionString
- the raw expression string to parsecontext
- a context for influencing the expression parsing routine- Returns:
- an
Expression
for the parsed expression - Throws:
ParseException
- if an exception occurred during parsing
-
doParseExpression
protected abstract Expression doParseExpression(String expressionString, @Nullable ParserContext context) throws ParseException Actually parse the expression string and return an Expression object.- Parameters:
expressionString
- the raw expression string to parsecontext
- a context for influencing this expression parsing routine (optional)- Returns:
- an evaluator for the parsed expression
- Throws:
ParseException
- if an exception occurred during parsing
-