org.jafer.interfaces
Interface QueryBuilder

All Known Implementing Classes:
QueryBuilder

public interface QueryBuilder

Interface for implementing QueryBuilder utility class. Allows the building of XML based queries

Author:
: Antony Corfield; Matthew Dovey; Colin Tatham

Method Summary
 org.w3c.dom.Node and(org.w3c.dom.Node leftNode, org.w3c.dom.Node rightNode)
          Produces an AND node from 2 nodes.
 org.w3c.dom.Node getNode(int[][] attTypesValues, java.lang.String term)
          Creates a basic query node incorporating the attributes and term supplied.
 org.w3c.dom.Node getNode(int[] attributes, java.lang.String term)
          Creates a basic query node incorporating the attributes and term supplied.
 org.w3c.dom.Node getNode(int useAttribute, java.lang.String term)
          Creates a basic query node incorporating the attribute and term supplied.
 org.w3c.dom.Node getNode(java.lang.String[] termAndAttributes)
          Creates a basic query node incorporating the term and attributes supplied.
 org.w3c.dom.Node getNode(java.lang.String attribute, java.lang.String term)
          Creates a basic query node incorporating the attribute and term supplied.
 org.w3c.dom.Node not(org.w3c.dom.Node inputNode)
          Produces a NOT node from a node.
 org.w3c.dom.Node or(org.w3c.dom.Node leftNode, org.w3c.dom.Node rightNode)
          Produces an OR node from 2 nodes.
 

Method Detail

getNode

org.w3c.dom.Node getNode(java.lang.String attribute,
                         java.lang.String term)
                         throws QueryException
Creates a basic query node incorporating the attribute and term supplied.

Throws:
QueryException

getNode

org.w3c.dom.Node getNode(int useAttribute,
                         java.lang.String term)
                         throws QueryException
Creates a basic query node incorporating the attribute and term supplied.

Throws:
QueryException

getNode

org.w3c.dom.Node getNode(int[] attributes,
                         java.lang.String term)
                         throws QueryException
Creates a basic query node incorporating the attributes and term supplied.

Throws:
QueryException

getNode

org.w3c.dom.Node getNode(int[][] attTypesValues,
                         java.lang.String term)
                         throws QueryException
Creates a basic query node incorporating the attributes and term supplied.

The int[][] parameter holds the attribute type and corresponding value.

Throws:
QueryException

getNode

org.w3c.dom.Node getNode(java.lang.String[] termAndAttributes)
                         throws QueryException
Creates a basic query node incorporating the term and attributes supplied.

The String[] parameter holds the term to be used in position [0], and the remaining attributes thereafter, eg:

{"Shakespeare", "1003", "3", "3", "2", "100", "1"}

Shorter arrays can be used, and values of "0" will cause that attribute to be omitted from the query.

(If a default search profile has been set, it will be ignored for this query)

Parameters:
termAndAttributes - the term (position [0]) and attributes to be used in the query.
Returns:
a query node.
Throws:
QueryException

and

org.w3c.dom.Node and(org.w3c.dom.Node leftNode,
                     org.w3c.dom.Node rightNode)
                     throws QueryException
Produces an AND node from 2 nodes.

Throws:
QueryException

or

org.w3c.dom.Node or(org.w3c.dom.Node leftNode,
                    org.w3c.dom.Node rightNode)
                    throws QueryException
Produces an OR node from 2 nodes.

Throws:
QueryException

not

org.w3c.dom.Node not(org.w3c.dom.Node inputNode)
                     throws QueryException
Produces a NOT node from a node.

Throws:
QueryException