com.fdsapi.arrays
Class WhereClauseTokens

java.lang.Object
  |
  +--com.fdsapi.arrays.WhereClauseTokens

public class WhereClauseTokens
extends java.lang.Object

Class that validates and gives a rules table for building both ArrayFilter and ArraySQL classes. Having a separate class to do this makes for much easier testing. This class can be tested indpendent of all the many other objects it takes to build ArrayFilters and the array of data it returns can easily be eyeballed for accuracy. Without this class testing ArrayFilter would be much more difficult. *

View Code

Author: Steve Souza

Nov 7, 2004


Constructor Summary
WhereClauseTokens()
           
 
Method Summary
 void addAnd()
           
 void addConditional(Conditional cond)
           
 void addLeftParen()
           
 void addNot()
           
 void addOr()
           
 void addRightParen()
           
 java.lang.Object[][] getCreateData()
           
static boolean getThrowValidationExceptions()
          Returns true if syntax exceptions will throw a RuntimeException
 WhereClauseToken[] getTokens()
           
 java.lang.String getValidationError()
          Returns a message of what the syntax validation error was if one occured
static void main(java.lang.String[] args)
           
static void setThrowValidationExceptions(boolean throwExceptions)
          if true syntax errors will throw a RuntimeException
 java.lang.String toString()
           
 boolean validate()
          Note by default this method throws a RuntimeException if there is a syntax error in the ArraySQL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WhereClauseTokens

public WhereClauseTokens()
Method Detail

setThrowValidationExceptions

public static void setThrowValidationExceptions(boolean throwExceptions)
if true syntax errors will throw a RuntimeException


getThrowValidationExceptions

public static boolean getThrowValidationExceptions()
Returns true if syntax exceptions will throw a RuntimeException


addConditional

public void addConditional(Conditional cond)

addLeftParen

public void addLeftParen()

addRightParen

public void addRightParen()

addAnd

public void addAnd()

addOr

public void addOr()

addNot

public void addNot()

getTokens

public WhereClauseToken[] getTokens()

getCreateData

public java.lang.Object[][] getCreateData()

validate

public boolean validate()
Note by default this method throws a RuntimeException if there is a syntax error in the ArraySQL. If this capability is disabled then validate will return a false if a parsing error occurs.


getValidationError

public java.lang.String getValidationError()
Returns a message of what the syntax validation error was if one occured


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)