Class QueryBuilder
- java.lang.Object
- 
- org.apache.jackrabbit.spi.commons.query.xpath.QueryBuilder
 
- 
- All Implemented Interfaces:
- QueryTreeBuilder
 
 public class QueryBuilder extends Object implements QueryTreeBuilder Implements the XPath query tree builder.
- 
- 
Constructor SummaryConstructors Constructor Description QueryBuilder()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(String language)Returnstrueif this query tree builder can handle a statement inlanguage.QueryRootNodecreateQueryTree(String statement, NameResolver resolver, QueryNodeFactory factory)Creates aQueryNodetree from a statement using the passed query node factory.String[]getSupportedLanguages()This builder supportsQuery.XPATH.StringtoString(QueryRootNode root, NameResolver resolver)Creates a String representation of the query node tree in the syntax thisQueryTreeBuildercan handle.
 
- 
- 
- 
Method Detail- 
createQueryTreepublic QueryRootNode createQueryTree(String statement, NameResolver resolver, QueryNodeFactory factory) throws InvalidQueryException Creates aQueryNodetree from a statement using the passed query node factory.- Specified by:
- createQueryTreein interface- QueryTreeBuilder
- Parameters:
- statement- the statement.
- resolver- the name resolver to use.
- factory- the query node factory to use.
- Returns:
- the QueryNodetree for the statement.
- Throws:
- InvalidQueryException- if the statement is malformed.
 
 - 
canHandlepublic boolean canHandle(String language) Returnstrueif this query tree builder can handle a statement inlanguage.- Specified by:
- canHandlein interface- QueryTreeBuilder
- Parameters:
- language- the language of a query statement to build a query tree.
- Returns:
- trueif this builder can handle- language;- falseotherwise.
 
 - 
getSupportedLanguagespublic String[] getSupportedLanguages() This builder supportsQuery.XPATH. Returns the set of query languages supported by this builder.- Specified by:
- getSupportedLanguagesin interface- QueryTreeBuilder
- Returns:
- String array containing the names of the supported languages.
 
 - 
toStringpublic String toString(QueryRootNode root, NameResolver resolver) throws InvalidQueryException Creates a String representation of the query node tree in the syntax thisQueryTreeBuildercan handle.- Specified by:
- toStringin interface- QueryTreeBuilder
- Parameters:
- root- the root of the query node tree.
- resolver- to resolve Names.
- 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.
 
 
- 
 
-