planetj.database.sql
Class AbstractExpressionToken

java.lang.Object
  extended byplanetj.database.sql.SQLToken
      extended byplanetj.database.sql.AbstractExpressionToken
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExpressionToken, InsertExpressionToken, SetExpressionToken

public abstract class AbstractExpressionToken
extends SQLToken

!!DA (6/11/2003 8:15:21 AM) documentation needed

See Also:
Serialized Form

Field Summary
static java.lang.String className
          Class name.
 
Fields inherited from class planetj.database.sql.SQLToken
WHITE_SPACE
 
Constructor Summary
AbstractExpressionToken()
          ExpressionToken constructor comment.
AbstractExpressionToken(java.lang.String pToken, TableStatement pStatement)
          ExpressionToken constructor comment.
 
Method Summary
protected  void addBasicComparison(java.lang.String pColToken, java.lang.String pOpToken, java.lang.String pValToken)
          Adds a new SQLComparison to this SQLExpression
protected  void addComparison(SQLComparison pComparison)
          Adds an existing SQLComparison to this SQLExpression
protected  void addSetComparison(java.lang.String pColToken, java.lang.String pOpToken, java.lang.String pValToken)
          Adds a new SQLComparison to this SQLExpression
 java.util.List getComparisonNames()
          Gets a List containing the names of the columns in the SQLComparisons.
 java.util.List getComparisons()
          Gets a List containing the SQLComparisons which comprise this ExpressionToken
 ValidationExceptionCollection getValidationExceptions()
          Deprecated. (6/11/2003 8:18:59 AM) This method will not allow setting the Field's default value from a user property. Replaced by getValidationExceptions(ExecutingContext)
 ValidationExceptionCollection getValidationExceptions(ExecutingContext ec)
          Be careful when you call this method because it is derived and spins through all the Fields of all the SQLComparisons in this expression token.
protected static boolean isConnector(java.lang.String s)
          Check to see if given String is a connector token.
 boolean isContainsDisplayParameters()
          Tests if this expression token contains one or more comparisons which have a display parameter for one or more of their values
 boolean isValueParameterPresent(int index)
          Tests if at least one of this ExpressionToken's comparisons has a parameter for a value (i.e.
protected abstract  void parseExpression(java.lang.String sql)
           
protected static java.util.List preparseExpression(java.lang.String pSQLString)
          Breaks the String apart in sections that are contained in quotes and sections that are not contained in quotes
 void setToken(java.lang.String pToken)
           
 java.lang.String toString()
           
 
Methods inherited from class planetj.database.sql.SQLToken
getStatement, getToken, isTokenParameter, isTokenWhiteSpace, setStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

public static final java.lang.String className
Class name.

Constructor Detail

AbstractExpressionToken

public AbstractExpressionToken()
ExpressionToken constructor comment.


AbstractExpressionToken

public AbstractExpressionToken(java.lang.String pToken,
                               TableStatement pStatement)
ExpressionToken constructor comment.

Parameters:
pToken - java.lang.String
Method Detail

addBasicComparison

protected void addBasicComparison(java.lang.String pColToken,
                                  java.lang.String pOpToken,
                                  java.lang.String pValToken)
Adds a new SQLComparison to this SQLExpression


addComparison

protected void addComparison(SQLComparison pComparison)
Adds an existing SQLComparison to this SQLExpression


addSetComparison

protected void addSetComparison(java.lang.String pColToken,
                                java.lang.String pOpToken,
                                java.lang.String pValToken)
Adds a new SQLComparison to this SQLExpression


getComparisonNames

public java.util.List getComparisonNames()
Gets a List containing the names of the columns in the SQLComparisons.


getComparisons

public java.util.List getComparisons()
Gets a List containing the SQLComparisons which comprise this ExpressionToken


getValidationExceptions

public ValidationExceptionCollection getValidationExceptions()
                                                      throws CMException
Deprecated. (6/11/2003 8:18:59 AM) This method will not allow setting the Field's default value from a user property. Replaced by getValidationExceptions(ExecutingContext)

Be careful when you call this method because it is derived and spins through all the Fields of all the SQLComparisons in this expression token. This will return a collection of al; the Exceptions of each Field.

Returns:
collection of validation exceptions.
Throws:
CMException

getValidationExceptions

public ValidationExceptionCollection getValidationExceptions(ExecutingContext ec)
                                                      throws CMException
Be careful when you call this method because it is derived and spins through all the Fields of all the SQLComparisons in this expression token. This will return a collection of al; the Exceptions of each Field.

Parameters:
ec - context in which code is executing.
Returns:
collection of validation exceptions.
Throws:
CMException

isConnector

protected static boolean isConnector(java.lang.String s)
Check to see if given String is a connector token.


isContainsDisplayParameters

public boolean isContainsDisplayParameters()
Tests if this expression token contains one or more comparisons which have a display parameter for one or more of their values


isValueParameterPresent

public boolean isValueParameterPresent(int index)
Tests if at least one of this ExpressionToken's comparisons has a parameter for a value (i.e. the value hasn't been specified yet)


parseExpression

protected abstract void parseExpression(java.lang.String sql)

preparseExpression

protected static java.util.List preparseExpression(java.lang.String pSQLString)
Breaks the String apart in sections that are contained in quotes and sections that are not contained in quotes

Returns:
A List containing Strings such that the Strings when concatenated together will equal the String passed in. The first String in the List will be "outside" quotes, the second String will be "inside" quotes, the third will be "outside", etc. String "inside" quotes includes the beginning and ending quote marks.

setToken

public void setToken(java.lang.String pToken)
Overrides:
setToken in class SQLToken

toString

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