freemarker.template.expression
Class ExpressionBuilder

java.lang.Object
  |
  +--freemarker.template.expression.ExpressionBuilder

public final class ExpressionBuilder
extends java.lang.Object

A TemplateParser can use this class's static build(java.util.List) method to build a complete Expression or sub-expression from a List of ExpressionElements.

Version:
$Id: ExpressionBuilder.java,v 1.20 2003/11/27 07:07:12 run2000 Exp $

Method Summary
static Expression build(java.util.List elements)
          Builds an Expression.
static Expression buildExpression(java.util.List elements)
          Builds an Expression or sub-Expression.
static Expression buildVariable(java.util.List elements)
          Builds a complete Variable.
static void groupParens(java.util.List elements)
          Encapsulates parenthetical expressions by putting them in sub-Lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

build

public static Expression build(java.util.List elements)
                        throws ParseException
Builds an Expression.
Parameters:
elements - a List of ExpressionElements.
Returns:
the complete Expression.
Throws:
ParseException - the builder could not create a valid Expression

buildExpression

public static Expression buildExpression(java.util.List elements)
                                  throws ParseException
Builds an Expression or sub-Expression.
Parameters:
elements - a List of ExpressionElements.
Returns:
the complete Expression or sub-Expression.
Throws:
ParseException - the builder could not create a valid Expression

groupParens

public static void groupParens(java.util.List elements)
                        throws ParseException
Encapsulates parenthetical expressions by putting them in sub-Lists.
Parameters:
elements - a List of ExpressionElements.
Throws:
ParseException - the builder could not create a valid Expression

buildVariable

public static Expression buildVariable(java.util.List elements)
                                throws ParseException
Builds a complete Variable.
Parameters:
elements - a List of ExpressionElements.
Returns:
the complete Variable.
Throws:
ParseException - the builder could not create a valid Variable