Package de.odysseus.el.tree
Class Tree
- java.lang.Object
-
- de.odysseus.el.tree.Tree
-
public class Tree extends java.lang.Object
Parsed expression, usually created by aTreeBuilder
. Thebind(FunctionMapper, VariableMapper)
method is used to createBindings
, which are needed at evaluation time to lookup functions and variables. The tree itself does not contain such information, because it would make the tree depend on the function/variable mapper supplied at parse time.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
deferred
private java.util.List<FunctionNode>
functions
private java.util.List<IdentifierNode>
identifiers
private ExpressionNode
root
-
Constructor Summary
Constructors Constructor Description Tree(ExpressionNode root, java.util.List<FunctionNode> functions, java.util.List<IdentifierNode> identifiers, boolean deferred)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bindings
bind(javax.el.FunctionMapper fnMapper, javax.el.VariableMapper varMapper)
Create a bindings.Bindings
bind(javax.el.FunctionMapper fnMapper, javax.el.VariableMapper varMapper, TypeConverter converter)
Create a bindings.java.lang.Iterable<FunctionNode>
getFunctionNodes()
Get function nodes (in no particular order)java.lang.Iterable<IdentifierNode>
getIdentifierNodes()
Get identifier nodes (in no particular order)ExpressionNode
getRoot()
boolean
isDeferred()
java.lang.String
toString()
-
-
-
Field Detail
-
root
private final ExpressionNode root
-
functions
private final java.util.List<FunctionNode> functions
-
identifiers
private final java.util.List<IdentifierNode> identifiers
-
deferred
private final boolean deferred
-
-
Constructor Detail
-
Tree
public Tree(ExpressionNode root, java.util.List<FunctionNode> functions, java.util.List<IdentifierNode> identifiers, boolean deferred)
Constructor.- Parameters:
root
- root nodefunctions
- collection of function nodesidentifiers
- collection of identifier nodes
-
-
Method Detail
-
getFunctionNodes
public java.lang.Iterable<FunctionNode> getFunctionNodes()
Get function nodes (in no particular order)
-
getIdentifierNodes
public java.lang.Iterable<IdentifierNode> getIdentifierNodes()
Get identifier nodes (in no particular order)
-
getRoot
public ExpressionNode getRoot()
- Returns:
- root node
-
isDeferred
public boolean isDeferred()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
bind
public Bindings bind(javax.el.FunctionMapper fnMapper, javax.el.VariableMapper varMapper)
Create a bindings.- Parameters:
fnMapper
- the function mapper to usevarMapper
- the variable mapper to use- Returns:
- tree bindings
-
bind
public Bindings bind(javax.el.FunctionMapper fnMapper, javax.el.VariableMapper varMapper, TypeConverter converter)
Create a bindings.- Parameters:
fnMapper
- the function mapper to usevarMapper
- the variable mapper to useconverter
- custom type converter- Returns:
- tree bindings
-
-