Class AbstractExpressionParser
java.lang.Object
org.springframework.binding.expression.support.AbstractExpressionParser
- All Implemented Interfaces:
ExpressionParser
- Direct Known Subclasses:
BeanWrapperExpressionParser
Abstract base class for parsing ${...} style expressions.
- Author:
- Keith Donald
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Expression
doParseExpression
(String expressionString, ParserContext context) boolean
Returns if this parser allows delimited eval expressions like${foo.bar}
.Returns the configured expression delimiter prefix.Returns the expression delimiter suffix.parseExpression
(String expressionString, ParserContext context) Parse the expression string and return a compiled Expression object you can use for evaluation.protected Map<String,
Expression> parseVariableExpressions
(ExpressionVariable[] variables) void
setAllowDelimitedEvalExpressions
(boolean allowDelmitedEvalExpressions) Sets if this parser allows eval expressions like ${foo.bar}.void
setExpressionPrefix
(String expressionPrefix) Sets the expression delimiter prefix.void
setExpressionSuffix
(String expressionSuffix) Sets the expression delimiter suffix.
-
Constructor Details
-
AbstractExpressionParser
public AbstractExpressionParser()
-
-
Method Details
-
getExpressionPrefix
Returns the configured expression delimiter prefix. Defaults to "${". -
setExpressionPrefix
Sets the expression delimiter prefix. -
getExpressionSuffix
Returns the expression delimiter suffix. Defaults to "}". -
setExpressionSuffix
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 interfaceExpressionParser
- 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:
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
-