|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.Expression
Abstract class with static methods for parsing SQL expressions.
| Field Summary | |
static int |
PRIORITY_ADD
Arbitrarily scaled priority number (for addition). |
static int |
PRIORITY_AND
Arbitrarily scaled priority number (for AND). |
static int |
PRIORITY_COMPARE
Arbitrarily scaled priority number (for comparisions). |
static int |
PRIORITY_MULTIPLY
Arbitrarily scaled priority number (for multiplication). |
static int |
PRIORITY_NOT
Arbitrarily scaled priority number (for NOT). |
static int |
PRIORITY_OR
Arbitrarily scaled priority number (for OR). |
protected static String[] |
sqlkeywords
List of SQL keywords. |
| Constructor Summary | |
(package private) |
Expression()
|
| Method Summary | |
static Function |
getBuiltinFunction(String name)
Get a new object representing a built-in SQL function. |
static boolean |
isKeyword(String word)
Static support method. |
static Function |
parseExpression(StreamTokenizer tokenizer,
DatabaseManager manager)
Parse an arbitrary SQL expression and return the root Function of the graph of Function's that results. |
static Function |
parseExpression(StreamTokenizer tokenizer,
DatabaseManager manager,
int priority_min)
Generalized version of above method. |
static Table |
parseTableExpression(StreamTokenizer tokenizer,
DatabaseManager manager)
Parse an arbitrary table expression. |
static Function |
parseValue(StreamTokenizer tokenizer,
DatabaseManager manager)
Parse an arbitrary SQL value and return the root Function of the graph of Function's that results. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int PRIORITY_MULTIPLY
public static final int PRIORITY_ADD
public static final int PRIORITY_COMPARE
public static final int PRIORITY_NOT
public static final int PRIORITY_AND
public static final int PRIORITY_OR
protected static final String[] sqlkeywords
| Constructor Detail |
Expression()
| Method Detail |
public static boolean isKeyword(String word)
word - word to check
public static Function getBuiltinFunction(String name)
throws SQLException
name - name of function to lookup (all lowercase)SQLException - if an error occurs
public static Function parseExpression(StreamTokenizer tokenizer,
DatabaseManager manager)
throws SQLException,
IOException
Parse an arbitrary SQL expression and return the root Function of the graph of Function's that results.
The first thing parseExpression() does is call parseValue(). The expression may consist of nothing more than a value parsable by parseValue().
tokenizer - StreamTokenizer that SQL tokens should be read frommanager - DatabaseManager currently in use (used for subqueries)SQLException - if a database-access error occursIOException - if there is a problem with the StreamTokenizer
public static Function parseExpression(StreamTokenizer tokenizer,
DatabaseManager manager,
int priority_min)
throws SQLException,
IOException
tokenizer - StreamTokenizer that SQL tokens should be read frommanager - DatabaseManager currently in use (used for subqueries)priority_min - stop if an operator with a low priority is foundSQLException - if a database-access error occursIOException - if there is a problem with the StreamTokenizer
public static Function parseValue(StreamTokenizer tokenizer,
DatabaseManager manager)
throws SQLException,
IOException
Parse an arbitrary SQL value and return the root Function of the graph of Function's that results. This method is useful for parsing literals '-5.43', single parameter operators 'NOT a=b', and subexpressions including row-constructors '(SELECT ...)'. Use parseExpression() for parsing general expressions.
tokenizer - StreamTokenizer that SQL tokens should be read frommanager - DatabaseManager currently in use (used for subqueries)SQLException - if a database-access error occursIOException - if there is a problem with the StreamTokenizer
public static Table parseTableExpression(StreamTokenizer tokenizer,
DatabaseManager manager)
throws SQLException,
IOException
([value [,...]]) for a single column([row-constructor [,...]]) for an explicit tableVALUES row-constructor [, ...] for an explicit tableSELECT ... for a query or subqueryrow-constructor is of the form
(column-value [, ...]) or SELECT ....tokenizer - StreamTokenizer that SQL tokens should be read frommanager - DatabaseManager currently in use (used for subqueries)SQLException - if a database-access error occursIOException - if there is a problem with the StreamTokenizer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||