de.odysseus.el.tree
Class Tree

java.lang.Object
  extended by de.odysseus.el.tree.Tree

public class Tree
extends java.lang.Object

Parsed expression, usually created by a TreeBuilder. The bind(FunctionMapper, VariableMapper) method is used to create Bindings, 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.

Author:
Christoph Beck

Constructor Summary
Tree(ExpressionNode root, java.util.Collection<FunctionNode> functions, java.util.Collection<IdentifierNode> identifiers, boolean deferred)
          Constructor.
 
Method Summary
 Bindings bind(FunctionMapper fnMapper, VariableMapper varMapper)
          Create a bindings.
 Bindings bind(FunctionMapper fnMapper, 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tree

public Tree(ExpressionNode root,
            java.util.Collection<FunctionNode> functions,
            java.util.Collection<IdentifierNode> identifiers,
            boolean deferred)
Constructor.

Parameters:
root - root node
functions - collection of function nodes
identifiers - 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 class java.lang.Object

bind

public Bindings bind(FunctionMapper fnMapper,
                     VariableMapper varMapper)
Create a bindings.

Parameters:
fnMapper - the function mapper to use
varMapper - the variable mapper to use
Returns:
tree bindings

bind

public Bindings bind(FunctionMapper fnMapper,
                     VariableMapper varMapper,
                     TypeConverter converter)
Create a bindings.

Parameters:
fnMapper - the function mapper to use
varMapper - the variable mapper to use
converter - custom type converter
Returns:
tree bindings

Copyright © 2006-2009 Odysseus Software GmbH.