Class CQNParser<O>
- java.lang.Object
-
- com.googlecode.cqengine.query.parser.common.QueryParser<O>
-
- com.googlecode.cqengine.query.parser.cqn.CQNParser<O>
-
public class CQNParser<O> extends QueryParser<O>
A parser for CQN queries - CQEngine-Native syntax. CQN syntax is based on how CQEngine queries look in native Java code, and the format returned byQuery#toString()
.- Author:
- Niall Gallagher
-
-
Field Summary
-
Fields inherited from class com.googlecode.cqengine.query.parser.common.QueryParser
attributes, fallbackValueParser, objectType, SYNTAX_ERROR_LISTENER, valueParsers
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <O> CQNParser<O>
forPojo(Class<O> pojoClass)
Creates a new CQNParser for the given POJO class.static <O> CQNParser<O>
forPojoWithAttributes(Class<O> pojoClass, Map<String,? extends Attribute<O,?>> attributes)
Creates a new CQNParser 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
-
-
-
-
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 classQueryParser<O>
- Parameters:
query
- The query to parse- Returns:
- An object encapsulating the parsed query and its query options
-
forPojo
public static <O> CQNParser<O> forPojo(Class<O> pojoClass)
Creates a new CQNParser for the given POJO class.- Parameters:
pojoClass
- The type of object stored in the collection- Returns:
- a new CQNParser for the given POJO class
-
forPojoWithAttributes
public static <O> CQNParser<O> forPojoWithAttributes(Class<O> pojoClass, Map<String,? extends Attribute<O,?>> attributes)
Creates a new CQNParser for the given POJO class, and registers the given attributes with it.- Parameters:
pojoClass
- The type of object stored in the collectionattributes
- The attributes to register with the parser- Returns:
- a new CQNParser for the given POJO class
-
-