public class QueryBuilder extends Object implements QueryTreeBuilder
Constructor and Description |
---|
QueryBuilder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(String language)
Returns
true if this query tree builder can handle a
statement in language . |
QueryRootNode |
createQueryTree(String statement,
NameResolver resolver,
QueryNodeFactory factory)
Creates a
QueryNode tree from a statement using the passed
query node factory. |
String[] |
getSupportedLanguages()
This builder supports
Query.SQL . |
String |
toString(QueryRootNode root,
NameResolver resolver)
Creates a String representation of the query node tree in the syntax this
QueryTreeBuilder can handle. |
public QueryRootNode createQueryTree(String statement, NameResolver resolver, QueryNodeFactory factory) throws javax.jcr.query.InvalidQueryException
QueryNode
tree from a statement using the passed
query node factory.createQueryTree
in interface QueryTreeBuilder
statement
- the statement.resolver
- the name resolver to use.factory
- the query node factory to use.QueryNode
tree for the statement.javax.jcr.query.InvalidQueryException
- if the statement is malformed.public boolean canHandle(String language)
true
if this query tree builder can handle a
statement in language
.canHandle
in interface QueryTreeBuilder
language
- the language of a query statement to build a query tree.true
if this builder can handle language
;
false
otherwise.public String[] getSupportedLanguages()
Query.SQL
.
Returns the set of query languages supported by this builder.getSupportedLanguages
in interface QueryTreeBuilder
public String toString(QueryRootNode root, NameResolver resolver) throws javax.jcr.query.InvalidQueryException
QueryTreeBuilder
can handle.toString
in interface QueryTreeBuilder
root
- the root of the query node tree.resolver
- to resolve Names.javax.jcr.query.InvalidQueryException
- if the query node tree cannot be converted
into a String representation due to
restrictions in this syntax.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.