org.springframework.expression.common
Class TemplateAwareExpressionParser

java.lang.Object
  extended by org.springframework.expression.common.TemplateAwareExpressionParser
All Implemented Interfaces:
ExpressionParser
Direct Known Subclasses:
SpelExpressionParser

public abstract class TemplateAwareExpressionParser
extends Object
implements ExpressionParser

An expression parser that understands templates. It can be subclassed by expression parsers that do not offer first class support for templating.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller, Andy Clement

Constructor Summary
TemplateAwareExpressionParser()
           
 
Method Summary
protected abstract  Expression doParseExpression(String expressionString, ParserContext context)
          Actually parse the expression string and return an Expression object.
 Expression parseExpression(String expressionString)
          Parse the expression string and return an Expression object you can use for repeated evaluation.
 Expression parseExpression(String expressionString, ParserContext context)
          Parse the expression string and return an Expression object you can use for repeated evaluation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateAwareExpressionParser

public TemplateAwareExpressionParser()
Method Detail

parseExpression

public Expression parseExpression(String expressionString)
                           throws ParseException
Description copied from interface: ExpressionParser
Parse the expression string and return an Expression object you can use for repeated evaluation.

Some examples:

     3 + 4
     name.firstName
 

Specified by:
parseExpression in interface ExpressionParser
Parameters:
expressionString - the raw expression string to parse
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing

parseExpression

public Expression parseExpression(String expressionString,
                                  ParserContext context)
                           throws ParseException
Description copied from interface: ExpressionParser
Parse the expression string and return an Expression object you can use for repeated 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:
ParseException - an exception occurred during parsing

doParseExpression

protected abstract Expression doParseExpression(String expressionString,
                                                ParserContext context)
                                         throws ParseException
Actually parse the expression string and return an Expression object.

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:
ParseException - an exception occurred during parsing