org.apache.jackrabbit.core.query
Interface QueryTreeBuilder

All Known Implementing Classes:
QueryBuilder, QueryBuilder

public interface QueryTreeBuilder

Specifies an interface for a query tree builder.


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

Method Detail

createQueryTree

QueryRootNode createQueryTree(String statement,
                              NamespaceResolver resolver)
                              throws InvalidQueryException
Creates a QueryNode tree from a statement.

Parameters:
statement - the statement.
resolver - the namespace resolver to use.
Returns:
the QueryNode tree for the statement.
Throws:
InvalidQueryException - if the statement is malformed.

canHandle

boolean canHandle(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

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

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

toString

String toString(QueryRootNode root,
                NamespaceResolver resolver)
                throws 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 QNames.
Returns:
a String representation of the query node tree.
Throws:
InvalidQueryException - if the query node tree cannot be converted into a String representation due to restrictions in this syntax.


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.