public class SQL2QOMBuilder extends 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 and Description |
---|
SQL2QOMBuilder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(String language)
Returns
true if this QOM builder can handle a statement in
language . |
javax.jcr.query.qom.QueryObjectModel |
createQueryObjectModel(String statement,
javax.jcr.query.qom.QueryObjectModelFactory qf,
javax.jcr.ValueFactory vf)
Creates a new query object model from the given
statement
using the passed QOM and value factory. |
String[] |
getSupportedLanguages()
Returns the set of query languages supported by this builder.
|
String |
toString(javax.jcr.query.qom.QueryObjectModel qom)
Creates a String representation of the query object model in the syntax
this
QueryObjectModelBuilder can handle. |
public javax.jcr.query.qom.QueryObjectModel createQueryObjectModel(String statement, javax.jcr.query.qom.QueryObjectModelFactory qf, javax.jcr.ValueFactory vf) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
statement
using the passed QOM and value factory.createQueryObjectModel
in interface QueryObjectModelBuilder
statement
- the query statement.qf
- the query object model factory.vf
- the value factory.javax.jcr.query.InvalidQueryException
- if the statement is invalid.javax.jcr.RepositoryException
- if another error occurs.public boolean canHandle(String language)
true
if this QOM builder can handle a statement in
language
.canHandle
in interface QueryObjectModelBuilder
language
- the language of a query statement to build a QOM.true
if this builder can handle
language
; false
otherwise.public String[] getSupportedLanguages()
getSupportedLanguages
in interface QueryObjectModelBuilder
public String toString(javax.jcr.query.qom.QueryObjectModel qom) throws javax.jcr.query.InvalidQueryException
QueryObjectModelBuilder
can handle.toString
in interface QueryObjectModelBuilder
qom
- the query object model.javax.jcr.query.InvalidQueryException
- if the query object model cannot be
converted into a String representation due
to restrictions in this syntax.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.