Class 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 by Query#toString().

    Author:
    Niall Gallagher
    • Constructor Detail

      • CQNParser

        public CQNParser​(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> 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 collection
        attributes - The attributes to register with the parser
        Returns:
        a new CQNParser for the given POJO class