Class ELExpressionParser
java.lang.Object
org.springframework.binding.expression.el.ELExpressionParser
- All Implemented Interfaces:
ExpressionParser
- Direct Known Subclasses:
JsfManagedBeanAwareELExpressionParser
,WebFlowELExpressionParser
The expression parser that parses EL expressions.
- Author:
- Keith Donald, Jeremy Grelle
-
Constructor Summary
ConstructorDescriptionELExpressionParser
(jakarta.el.ExpressionFactory expressionFactory) Creates a new EL expression parser for standalone usage. -
Method Summary
Modifier and TypeMethodDescriptionThe conversion service to use to perform type conversions as needed by the Unified EL system.parseExpression
(String expressionString, ParserContext context) Parse the expression string and return a compiled Expression object you can use for evaluation.void
putContextFactory
(Class<?> contextType, ELContextFactory contextFactory) Register the ELContextFactory for expressions that evaluate the given class of context object.void
setConversionService
(ConversionService conversionService) Sets the conversion service to use to perform type conversions as needed by the Unified EL system.
-
Constructor Details
-
ELExpressionParser
public ELExpressionParser(jakarta.el.ExpressionFactory expressionFactory) Creates a new EL expression parser for standalone usage.
-
-
Method Details
-
getConversionService
The conversion service to use to perform type conversions as needed by the Unified EL system. If not specified, the default is an instance ofDefaultConversionService
. -
setConversionService
Sets the conversion service to use to perform type conversions as needed by the Unified EL system.- Parameters:
conversionService
- the conversion service to use
-
putContextFactory
Register the ELContextFactory for expressions that evaluate the given class of context object.- Parameters:
contextType
- the expression context classcontextFactory
- the context factory to use for expressions that evaluate those types of contexts
-
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
-