Package org.apache.el.lang
Class ExpressionBuilder
- java.lang.Object
-
- org.apache.el.lang.ExpressionBuilder
-
- All Implemented Interfaces:
org.apache.el.parser.NodeVisitor
public final class ExpressionBuilder extends java.lang.Object implements org.apache.el.parser.NodeVisitorBuilds compiled EL expressions from parsed AST nodes.
-
-
Constructor Summary
Constructors Constructor Description ExpressionBuilder(java.lang.String expression, ELContext ctx)Creates a new ExpressionBuilder for the given expression and context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodExpressioncreateMethodExpression(java.lang.Class<?> expectedReturnType, java.lang.Class<?>[] expectedParamTypes)Creates a MethodExpression from the parsed expression.static org.apache.el.parser.NodecreateNode(java.lang.String expr)Creates a parsed AST node for the given expression string.ValueExpressioncreateValueExpression(java.lang.Class<?> expectedType)Creates a ValueExpression from the parsed expression.voidvisit(org.apache.el.parser.Node node)Visits the given node.
-
-
-
Constructor Detail
-
ExpressionBuilder
public ExpressionBuilder(java.lang.String expression, ELContext ctx) throws ELExceptionCreates 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 Detail
-
createNode
public static org.apache.el.parser.Node createNode(java.lang.String expr) throws ELExceptionCreates 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
public void visit(org.apache.el.parser.Node node) throws ELExceptionDescription 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
public ValueExpression createValueExpression(java.lang.Class<?> expectedType) throws ELException
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(java.lang.Class<?> expectedReturnType, java.lang.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
-
-