com.googlecode.cqengine.query.parser.sql
Class SQLParser<O>

java.lang.Object
  extended by com.googlecode.cqengine.query.parser.common.QueryParser<O>
      extended by com.googlecode.cqengine.query.parser.sql.SQLParser<O>

public class SQLParser<O>
extends QueryParser<O>

A parser for SQL queries.

Author:
Niall Gallagher

Field Summary
 
Fields inherited from class com.googlecode.cqengine.query.parser.common.QueryParser
attributes, fallbackValueParser, objectType, SYNTAX_ERROR_LISTENER, valueParsers
 
Constructor Summary
SQLParser(Class<O> objectType)
           
 
Method Summary
static
<O> SQLParser<O>
forPojo(Class<O> pojoClass)
          Creates a new SQLParser for the given POJO class.
static
<O> SQLParser<O>
forPojoWithAttributes(Class<O> pojoClass, Map<String,? extends Attribute<O,?>> attributes)
          Creates a new SQLParser for the given POJO class, and registers the given attributes with it.
 ParseResult<O> parse(String query)
          Parses the given query and its query options, encapsulating both in the object returned.
 
Methods inherited from class com.googlecode.cqengine.query.parser.common.QueryParser
getAttribute, getObjectType, parseValue, parseValue, parseValue, query, queryOptions, registerAttribute, registerAttributes, registerAttributes, registerFallbackValueParser, registerValueParser, retrieve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLParser

public SQLParser(Class<O> objectType)
Method Detail

parse

public ParseResult<O> parse(String query)
Description copied from class: QueryParser
Parses the given query and its query options, encapsulating both in the object returned.

Specified by:
parse in class QueryParser<O>
Parameters:
query - The query to parse
Returns:
An object encapsulating the parsed query and its query options

forPojo

public static <O> SQLParser<O> forPojo(Class<O> pojoClass)
Creates a new SQLParser for the given POJO class.

Parameters:
pojoClass - The type of object stored in the collection
Returns:
a new SQLParser for the given POJO class

forPojoWithAttributes

public static <O> SQLParser<O> forPojoWithAttributes(Class<O> pojoClass,
                                                     Map<String,? extends Attribute<O,?>> attributes)
Creates a new SQLParser for the given POJO class, and registers the given attributes with it.

Parameters:
pojoClass - The type of object stored in the collection
attributes - The attributes to register with the parser
Returns:
a new SQLParser for the given POJO class


Copyright © 2016. All rights reserved.