org.springframework.binding.expression.support
Class AbstractExpressionParser

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

public abstract class AbstractExpressionParser
extends java.lang.Object
implements ExpressionParser

Abstract base class for expression parsers.

Author:
Keith Donald, Erwin Vervaet

Constructor Summary
AbstractExpressionParser()
           
 
Method Summary
protected abstract  Expression doParseExpression(java.lang.String expressionString)
          Template method for parsing a filtered expression string.
protected abstract  SettableExpression doParseSettableExpression(java.lang.String expressionString)
          Template method for parsing a filtered settable expression string.
 java.lang.String getExpressionPrefix()
          Returns the configured expression delimiter prefix.
 java.lang.String getExpressionSuffix()
          Returns the expression delimiter suffix.
 boolean isDelimitedExpression(java.lang.String expressionString)
          Check whether or not given criteria are expressed as an expression.
 Expression parseExpression(java.lang.String expressionString)
          Parse the provided expression string, returning an evaluator capable of evaluating it against input.
 SettableExpression parseSettableExpression(java.lang.String expressionString)
          Parse the provided settable expression string, returning an evaluator capable of evaluating its value as well as setting its value.
 void setExpressionPrefix(java.lang.String expressionPrefix)
          Sets the expression delimiter prefix.
 void setExpressionSuffix(java.lang.String expressionSuffix)
          Sets the expression delimiter suffix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExpressionParser

public AbstractExpressionParser()
Method Detail

getExpressionPrefix

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


setExpressionPrefix

public void setExpressionPrefix(java.lang.String expressionPrefix)
Sets the expression delimiter prefix.


getExpressionSuffix

public java.lang.String getExpressionSuffix()
Returns the expression delimiter suffix. Defaults to "}".


setExpressionSuffix

public void setExpressionSuffix(java.lang.String expressionSuffix)
Sets the expression delimiter suffix.


isDelimitedExpression

public boolean isDelimitedExpression(java.lang.String expressionString)
Check whether or not given criteria are expressed as an expression.

Specified by:
isDelimitedExpression in interface ExpressionParser
Parameters:
expressionString - the proposed expression string
Returns:
true if yes, false if not

parseExpression

public final Expression parseExpression(java.lang.String expressionString)
                                 throws ParserException
Description copied from interface: ExpressionParser
Parse the provided expression string, returning an evaluator capable of evaluating it against input.

Specified by:
parseExpression in interface ExpressionParser
Parameters:
expressionString - the parseable expression string
Returns:
the evaluator for the parsed expression
Throws:
ParserException - an exception occured during parsing

parseSettableExpression

public final SettableExpression parseSettableExpression(java.lang.String expressionString)
                                                 throws ParserException,
                                                        java.lang.UnsupportedOperationException
Description copied from interface: ExpressionParser
Parse the provided settable expression string, returning an evaluator capable of evaluating its value as well as setting its value.

Specified by:
parseSettableExpression in interface ExpressionParser
Parameters:
expressionString - the parseable expression string
Returns:
the evaluator for the parsed expression
Throws:
ParserException - an exception occured during parsing
java.lang.UnsupportedOperationException - this parser does not support settable expressions

doParseExpression

protected abstract Expression doParseExpression(java.lang.String expressionString)
                                         throws ParserException
Template method for parsing a filtered expression string. Subclasses should override.

Parameters:
expressionString - the expression string
Returns:
the parsed expression
Throws:
ParserException - an exception occured during parsing

doParseSettableExpression

protected abstract SettableExpression doParseSettableExpression(java.lang.String expressionString)
                                                         throws ParserException,
                                                                java.lang.UnsupportedOperationException
Template method for parsing a filtered settable expression string. Subclasses should override.

Parameters:
expressionString - the expression string
Returns:
the parsed expression
Throws:
ParserException - an exception occured during parsing
java.lang.UnsupportedOperationException - this parser does not support settable expressions


Copyright � 2004-2007. All Rights Reserved.