org.priha.query.aqt
Interface QueryTreeBuilder

All Known Implementing Classes:
QueryBuilder

public interface QueryTreeBuilder

Specifies an interface for a query tree builder.


Method Summary
 boolean canHandle(java.lang.String language)
          Returns true if this query tree builder can handle a statement in language.
 QueryRootNode createQueryTree(java.lang.String statement, NamespaceMapper resolver, QueryNodeFactory factory)
          Creates a QueryNode tree from a statement using the passed query node factory.
 java.lang.String[] getSupportedLanguages()
          Returns the set of query languages supported by this builder.
 java.lang.String toString(QueryRootNode root, NamespaceMapper resolver)
          Creates a String representation of the query node tree in the syntax this QueryTreeBuilder can handle.
 

Method Detail

createQueryTree

QueryRootNode createQueryTree(java.lang.String statement,
                              NamespaceMapper resolver,
                              QueryNodeFactory factory)
                              throws javax.jcr.query.InvalidQueryException
Creates a QueryNode tree from a statement using the passed query node factory.

Parameters:
statement - the statement.
resolver - the name resolver to use.
factory - the query node factory to use.
Returns:
the QueryNode tree for the statement.
Throws:
javax.jcr.query.InvalidQueryException - if the statement is malformed.

canHandle

boolean canHandle(java.lang.String language)
Returns true if this query tree builder can handle a statement in language.

Parameters:
language - the language of a query statement to build a query tree.
Returns:
true if this builder can handle language; false otherwise.

getSupportedLanguages

java.lang.String[] getSupportedLanguages()
Returns the set of query languages supported by this builder.

Returns:
String array containing the names of the supported languages.

toString

java.lang.String toString(QueryRootNode root,
                          NamespaceMapper resolver)
                          throws javax.jcr.query.InvalidQueryException
Creates a String representation of the query node tree in the syntax this QueryTreeBuilder can handle.

Parameters:
root - the root of the query node tree.
resolver - to resolve Names.
Returns:
a String representation of the query node tree.
Throws:
javax.jcr.query.InvalidQueryException - if the query node tree cannot be converted into a String representation due to restrictions in this syntax.