edu.cmu.aura.service.query.parser
Class QParser
java.lang.Object
|
+--edu.cmu.aura.service.query.parser.QParser
- public class QParser
- extends java.lang.Object
This class parses String expressions into a Query object.
The PQuery object can be be used to invoke PrimitiveService
methods without the need to create an expression manually.
Note that unlike SQL, the query parse is case sensitive.
QParser is capable of parsing four types of literal values
in expressions: String, Boolean, Double, and Integer.
All quoted literals are parsed as String. All unquoted literals
with the values true or false are parsed as Boolean. All
numeric literals with a decimal point are parsed as Double.
All numeric literals without a decimal point are parsed as
Integer. Be sure to use the type of literal your service
supports. Be especially careful with Integer and Double
because your service may not automatically convert.
Examples:
"select * from City"
"select * from City where name="Pittsburgh" OR name="Columbus"
"select name, temp from CityTemp where name!="Pittsburgh"
- See Also:
Query
|
Method Summary |
static void |
main(java.lang.String[] args)
|
Query |
parseQuery(java.io.InputStream inStream,
int querySize)
|
Query |
parseQuery(java.lang.String queryDef)
|
void |
parseSelect(edu.cmu.aura.service.query.parser.PQuery pQuery,
java.util.ArrayList selectTokens)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QParser
public QParser()
parseQuery
public Query parseQuery(java.io.InputStream inStream,
int querySize)
throws QParseException,
java.io.IOException
QParseException
java.io.IOException
parseQuery
public Query parseQuery(java.lang.String queryDef)
throws QParseException
QParseException
parseSelect
public void parseSelect(edu.cmu.aura.service.query.parser.PQuery pQuery,
java.util.ArrayList selectTokens)
throws QParseException
QParseException
main
public static void main(java.lang.String[] args)