|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jafer.query.QueryBuilder
Class for building XML representations of queries.
All methods use a default search profile if one has been set in ZClient.
Some getNode() methods allow the default search profile to be altered for that query.
(The value of the term supplied to each method cannot be null or an empty String).
See also: org.jafer.zclient.ZClient setsearchProfile().
| Field Summary | |
(package private) int[] |
defaultAttributes
|
private org.w3c.dom.Document |
document
|
(package private) boolean |
dummyNodePresent
|
| Constructor Summary | |
QueryBuilder()
|
|
QueryBuilder(java.lang.String searchProfile)
|
|
| Method Summary | |
org.w3c.dom.Node |
and(org.w3c.dom.Node leftNode,
org.w3c.dom.Node rightNode)
Produces an AND node from 2 nodes, which can be query nodes, or AND, OR or NOT nodes. |
org.w3c.dom.Node |
and(java.util.Vector useAttributes,
java.util.Vector terms)
Produces an AND node from a pair of attributes, or a tree of AND nodes if more than 2 attributes are given. |
private org.w3c.dom.Node |
buildConstraintModelNode(int[] attributes,
java.lang.String term)
|
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 queryExp)
|
org.w3c.dom.Node |
getNode(java.lang.String useAttribute,
java.lang.String term)
Creates a basic query node incorporating the attribute and term supplied. |
boolean |
isDummyNodePresent()
Gets the value of the dummyNodePresent flag. |
private int |
lookUpUseAttribute(java.lang.String attributeString)
|
org.w3c.dom.Node |
not(org.w3c.dom.Node inputNode)
Produces a NOT node from the supplied node. |
org.w3c.dom.Node |
or(org.w3c.dom.Node leftNode,
org.w3c.dom.Node rightNode)
Produces an OR node from 2 nodes, which can be query nodes, or AND, OR or NOT nodes. |
org.w3c.dom.Node |
or(java.util.Vector useAttributes,
java.util.Vector terms)
Produces an OR node from a pair of attributes, or a tree of OR nodes if more than 2 attributes are given. |
org.w3c.dom.Node |
parse(org.w3c.dom.Node queryNode)
Parses the query node before submission. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private org.w3c.dom.Document document
int[] defaultAttributes
boolean dummyNodePresent
| Constructor Detail |
public QueryBuilder()
public QueryBuilder(java.lang.String searchProfile)
| Method Detail |
public org.w3c.dom.Node getNode(java.lang.String useAttribute,
java.lang.String term)
throws QueryException
Attribute supplied must be a Use attribute.
Attribute value is checked against lookup table in ???????org.jafer.util.Bib1Attributes.
getNode in interface QueryBuilderuseAttribute - represents the Use attribute to be used in the query, e.g. "title".term - the term to be used in the query.
lookUpUseAttribute()??????
org.jafer.zclient.QueryException - if useAttribute parameter is not found ?????.
QueryException
public org.w3c.dom.Node getNode(int useAttribute,
java.lang.String term)
throws QueryException
Attribute supplied can only be a Use attribute.
useAttribute parameter is checked against lookup table in
org.jafer.util.Bib1Attributes.java.
getNode in interface QueryBuilderuseAttribute - represents the Use attribute to be used in the query.term - the term to be used in the query.
getNode(int[] attributes, String term)
org.jafer.zclient.QueryException - if useAttribute parameter
is not within the ranges in the look-up table??????????????.
QueryException
public org.w3c.dom.Node getNode(int[] attributes,
java.lang.String term)
throws QueryException
The int[] parameter values are used in order for:
{Use, Relation, Position, Structure, Truncation, Completeness}
e.g. { 4, 3, 3, 2, 100, 1 }
A smaller sized array can be used, in which case the values given will be interpreted in order, following the pattern above.
If a default search profile has been set, it will be altered for this query: any values given in the parameter will replace corresponding default values.
(A parameter value of 0 will result in the corresponding attribute type to be excluded from the query.)
getNode in interface QueryBuilderattributes - represents the attribute values to be used in the query.term - the term to be used in the query.
buildConstraintModelNode(int[] attributes, String term)
org.jafer.zclient.QueryException - if attributes array size
is smaller than 1, or larger than 6.
Also if the first attributes element is 0, or term is an empty String or null.
QueryException
public org.w3c.dom.Node getNode(int[][] attTypesValues,
java.lang.String term)
throws QueryException
The int[][] parameter holds the attribute types and corresponding values.
e.g. {{1,1003}, {2,3}, {4,2}} would set:
Use = 1003, Relation = 3 and Structure = 2.
If a default search profile has been set, it will be altered for this query: any values given in the parameter will replace corresponding default values. (A parameter value of 0 will result in the corresponding attribute type to be excluded from the query.)
getNode in interface QueryBuilderattTypesValues - represents the attribute types and their corresponding
values to be used in the query.term - the term to be used in the query.
buildConstraintModelNode(int[] attributes, String term)
org.jafer.zclient.QueryException - if attTypesValues array size is smaller than 1, or larger than 6.
Also if the first attributes element is 0, or not supplied.
Also if term is an empty String or null.
QueryException
private org.w3c.dom.Node buildConstraintModelNode(int[] attributes,
java.lang.String term)
throws QueryException
QueryException
public org.w3c.dom.Node and(org.w3c.dom.Node leftNode,
org.w3c.dom.Node rightNode)
throws QueryException
and in interface QueryBuilderleftNode - a query, AND, OR or NOT node.rightNode - a query, AND, OR or NOT node.
QueryException
public org.w3c.dom.Node and(java.util.Vector useAttributes,
java.util.Vector terms)
throws QueryException
Vector parameters: Minimum size is 2, and must contain only String objects.
Attributes supplied must be Use attributes.
Attribute values are checked against lookup table in org.jafer.util.Bib1Attributes??????????????.
useAttributes - the attribute values to be used in building the query.terms - the corresponding terms to be used in building the query.
QueryException
public org.w3c.dom.Node or(org.w3c.dom.Node leftNode,
org.w3c.dom.Node rightNode)
throws QueryException
or in interface QueryBuilderleftNode - a query, AND, OR or NOT node.rightNode - a query, AND, OR or NOT node.
QueryException
public org.w3c.dom.Node or(java.util.Vector useAttributes,
java.util.Vector terms)
throws QueryException
Vector parameters: minimum size is 2, and must contain only String objects.
Attributes supplied must be Use attributes.
Attribute values are checked against lookup table in org.jafer.util.Bib1Attributes.
useAttributes - the attribute values to be used in building the query.terms - the corresponding terms to be used in building the query.
QueryException
public org.w3c.dom.Node not(org.w3c.dom.Node inputNode)
throws QueryException
not in interface QueryBuilderinputNode - a query, AND or OR node.
QueryException
public org.w3c.dom.Node parse(org.w3c.dom.Node queryNode)
throws QueryException
This method is called from ZClient.
queryNode - the unparsed query node.
QueryExceptionpublic boolean isDummyNodePresent()
returns true if a dummy node was created in QueryParser.makeDummyNode().
public org.w3c.dom.Node getNode(java.lang.String queryExp)
throws QueryException
QueryException
private int lookUpUseAttribute(java.lang.String attributeString)
throws QueryException
QueryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||