isql.builder
Class ExpressionBuilder

java.lang.Object
  extended by isql.builder.ExpressionBuilder
Direct Known Subclasses:
SelectExpressionBuilder, WhereExpressionBuilder

public abstract class ExpressionBuilder
extends java.lang.Object

From the parsed expressions (in the select part or in the where part of the SQL statement) extracts expression trees that can be used to calculate the result set

Author:
SHZ Oct 11, 2007

Constructor Summary
ExpressionBuilder(ColumnValues values)
          Constructor
 
Method Summary
 IConstant buildConstant(ISQLSelectParser.IConstant constant)
          Builds a constant object from an ANTLR parsed constant (t can be a numeric, text, date, boolean)
 IExpression buildExpression(ISQLSelectParser.IExpression expression)
          The main method to extract the expression tree from an ANTLR parsed expression.
static ColumnKey buildTableColumn(ISQLSelectParser.TableColumn tableColumn)
          Builds a table column object from the column identifier coming from ANTLR
static java.sql.Timestamp fromPartialString(java.lang.String partial)
          extracts a date (Timestamp) from a date string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionBuilder

public ExpressionBuilder(ColumnValues values)
Constructor

Parameters:
values - the columns built from the arrays matching the select items
Method Detail

buildExpression

public IExpression buildExpression(ISQLSelectParser.IExpression expression)
                            throws ISQLException
The main method to extract the expression tree from an ANTLR parsed expression.

Parameters:
expression - the ANTLR expression
Returns:
the expression tree that will be used to execute the query
Throws:
ISQLException

buildTableColumn

public static ColumnKey buildTableColumn(ISQLSelectParser.TableColumn tableColumn)
Builds a table column object from the column identifier coming from ANTLR

Parameters:
tableColumn - the ANTLR column identifier
Returns:
the column identifier

buildConstant

public IConstant buildConstant(ISQLSelectParser.IConstant constant)
                        throws java.lang.AssertionError,
                               ISQLException
Builds a constant object from an ANTLR parsed constant (t can be a numeric, text, date, boolean)

Parameters:
constant - the constant coming from ANTLR
Returns:
the constant (text, number...)
Throws:
java.lang.AssertionError
ISQLException

fromPartialString

public static java.sql.Timestamp fromPartialString(java.lang.String partial)
                                            throws java.lang.IllegalArgumentException
extracts a date (Timestamp) from a date string

Parameters:
partial - the date string
Returns:
the extracted date
Throws:
java.lang.IllegalArgumentException