Class SQL2QOMBuilder

  • All Implemented Interfaces:
    QueryObjectModelBuilder

    public class SQL2QOMBuilder
    extends java.lang.Object
    implements QueryObjectModelBuilder
    SQL2QOMBuilder implements QOM builder that understands Query.JCR_SQL2 and Query.JCR_JQOM. JCR_JQOM might be surprising, but JSR 283 says that the serialization format of JCR_JQOM is JCR_SQL2. This is important when a JQOM is stored on a node as a serialized String and a language property set to JCR_JQOM.
    • Constructor Summary

      Constructors 
      Constructor Description
      SQL2QOMBuilder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canHandle​(java.lang.String language)
      Returns true if this QOM builder can handle a statement in language.
      QueryObjectModel createQueryObjectModel​(java.lang.String statement, QueryObjectModelFactory qf, ValueFactory vf)
      Creates a new query object model from the given statement using the passed QOM and value factory.
      java.lang.String[] getSupportedLanguages()
      Returns the set of query languages supported by this builder.
      java.lang.String toString​(QueryObjectModel qom)
      Creates a String representation of the query object model in the syntax this QueryObjectModelBuilder can handle.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SQL2QOMBuilder

        public SQL2QOMBuilder()
    • Method Detail

      • canHandle

        public boolean canHandle​(java.lang.String language)
        Returns true if this QOM builder can handle a statement in language.
        Specified by:
        canHandle in interface QueryObjectModelBuilder
        Parameters:
        language - the language of a query statement to build a QOM.
        Returns:
        true if this builder can handle language; false otherwise.
      • getSupportedLanguages

        public java.lang.String[] getSupportedLanguages()
        Returns the set of query languages supported by this builder.
        Specified by:
        getSupportedLanguages in interface QueryObjectModelBuilder
        Returns:
        String array containing the names of the supported languages.
      • toString

        public java.lang.String toString​(QueryObjectModel qom)
                                  throws InvalidQueryException
        Creates a String representation of the query object model in the syntax this QueryObjectModelBuilder can handle.
        Specified by:
        toString in interface QueryObjectModelBuilder
        Parameters:
        qom - the query object model.
        Returns:
        a String representation of the QOM.
        Throws:
        InvalidQueryException - if the query object model cannot be converted into a String representation due to restrictions in this syntax.