Class SQL2QOMBuilder
- java.lang.Object
-
- org.apache.jackrabbit.commons.query.sql2.SQL2QOMBuilder
-
- All Implemented Interfaces:
QueryObjectModelBuilder
public class SQL2QOMBuilder extends java.lang.Object implements QueryObjectModelBuilder
SQL2QOMBuilderimplements QOM builder that understandsQuery.JCR_SQL2andQuery.JCR_JQOM.JCR_JQOMmight be surprising, but JSR 283 says that the serialization format ofJCR_JQOMisJCR_SQL2. This is important when a JQOM is stored on a node as a serialized String and a language property set toJCR_JQOM.
-
-
Constructor Summary
Constructors Constructor Description SQL2QOMBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(java.lang.String language)Returnstrueif this QOM builder can handle a statement inlanguage.javax.jcr.query.qom.QueryObjectModelcreateQueryObjectModel(java.lang.String statement, javax.jcr.query.qom.QueryObjectModelFactory qf, javax.jcr.ValueFactory vf)Creates a new query object model from the givenstatementusing the passed QOM and value factory.java.lang.String[]getSupportedLanguages()Returns the set of query languages supported by this builder.java.lang.StringtoString(javax.jcr.query.qom.QueryObjectModel qom)Creates a String representation of the query object model in the syntax thisQueryObjectModelBuildercan handle.
-
-
-
Method Detail
-
createQueryObjectModel
public javax.jcr.query.qom.QueryObjectModel createQueryObjectModel(java.lang.String statement, javax.jcr.query.qom.QueryObjectModelFactory qf, javax.jcr.ValueFactory vf) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryExceptionCreates a new query object model from the givenstatementusing the passed QOM and value factory.- Specified by:
createQueryObjectModelin interfaceQueryObjectModelBuilder- Parameters:
statement- the query statement.qf- the query object model factory.vf- the value factory.- Returns:
- the query object model for the given statement.
- Throws:
javax.jcr.query.InvalidQueryException- if the statement is invalid.javax.jcr.RepositoryException- if another error occurs.
-
canHandle
public boolean canHandle(java.lang.String language)
Returnstrueif this QOM builder can handle a statement inlanguage.- Specified by:
canHandlein interfaceQueryObjectModelBuilder- Parameters:
language- the language of a query statement to build a QOM.- Returns:
trueif this builder can handlelanguage;falseotherwise.
-
getSupportedLanguages
public java.lang.String[] getSupportedLanguages()
Returns the set of query languages supported by this builder.- Specified by:
getSupportedLanguagesin interfaceQueryObjectModelBuilder- Returns:
- String array containing the names of the supported languages.
-
toString
public java.lang.String toString(javax.jcr.query.qom.QueryObjectModel qom) throws javax.jcr.query.InvalidQueryExceptionCreates a String representation of the query object model in the syntax thisQueryObjectModelBuildercan handle.- Specified by:
toStringin interfaceQueryObjectModelBuilder- Parameters:
qom- the query object model.- Returns:
- a String representation of the QOM.
- Throws:
javax.jcr.query.InvalidQueryException- if the query object model cannot be converted into a String representation due to restrictions in this syntax.
-
-