Class ExpressionBuilder
java.lang.Object
org.apache.el.lang.ExpressionBuilder
- All Implemented Interfaces:
org.apache.el.parser.NodeVisitor
Builds compiled EL expressions from parsed AST nodes.
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionBuilder(String expression, ELContext ctx) Creates a new ExpressionBuilder for the given expression and context. -
Method Summary
Modifier and TypeMethodDescriptioncreateMethodExpression(Class<?> expectedReturnType, Class<?>[] expectedParamTypes) Creates a MethodExpression from the parsed expression.static org.apache.el.parser.NodecreateNode(String expr) Creates a parsed AST node for the given expression string.createValueExpression(Class<?> expectedType) Creates a ValueExpression from the parsed expression.voidvisit(org.apache.el.parser.Node node) Visits the given node.
-
Constructor Details
-
ExpressionBuilder
Creates a new ExpressionBuilder for the given expression and context.- Parameters:
expression- the EL expression stringctx- the EL context- Throws:
ELException- if the expression is invalid
-
-
Method Details
-
createNode
Creates a parsed AST node for the given expression string.- Parameters:
expr- the expression string to parse- Returns:
- the parsed AST node
- Throws:
ELException- if parsing fails
-
visit
Description copied from interface:org.apache.el.parser.NodeVisitorVisits the given node.- Specified by:
visitin interfaceorg.apache.el.parser.NodeVisitor- Parameters:
node- the node to visit- Throws:
ELException
-
createValueExpression
Creates a ValueExpression from the parsed expression.- Parameters:
expectedType- the expected type of the expression result- Returns:
- the value expression
- Throws:
ELException- if expression building fails
-
createMethodExpression
public MethodExpression createMethodExpression(Class<?> expectedReturnType, Class<?>[] expectedParamTypes) throws ELException Creates a MethodExpression from the parsed expression.- Parameters:
expectedReturnType- the expected return typeexpectedParamTypes- the expected parameter types- Returns:
- the method expression
- Throws:
ELException- if expression building fails
-