Class CQLTermNode
java.lang.Object
org.z3950.zing.cql.CQLNode
org.z3950.zing.cql.CQLTermNode
Represents a terminal node in a CQL parse-tree.
A term node consists of the term String itself, together with,
optionally, an index string and a relation. Neither or both of
these must be provided - you can't have an index without a
relation or vice versa.
-
Field Summary
Fields inherited from class CQLNode
APPLICATION, BITSTRING, BOOLEAN, CONSTRUCTED, CONTEXT, ENUMERATED, EXTERNAL, GENERALSTRING, INTEGER, NULL, OBJECTDESCRIPTOR, OBJECTIDENTIFIER, OCTETSTRING, PRIMITIVE, PRIVATE, SEQUENCE, SET, UNIVERSAL, VISIBLESTRING -
Constructor Summary
ConstructorsConstructorDescriptionCQLTermNode(String index, CQLRelation relation, String term) Creates a new term node with the specifiedindex,relationandterm. -
Method Summary
Modifier and TypeMethodDescriptiongetIndex()Returns the name of the result-set to which this query is a reference, if and only if the entire query consists only of a result-set reference.getTerm()toCQL()Decompiles a parse-tree into a CQL query.toPQF(Properties config) Renders a parse-tree into a Yaz-style PQF string.byte[]toType1BER(Properties config) Renders a parser-tree into a BER-endoded packet representing an equivalent Z39.50 Type-1 query.voidtraverse(CQLNodeVisitor visitor)
-
Constructor Details
-
CQLTermNode
Creates a new term node with the specifiedindex,relationandterm. The first two may benull, but thetermmay not.
-
-
Method Details
-
getIndex
-
getRelation
-
getTerm
-
traverse
-
getResultSetName
Description copied from class:CQLNodeReturns the name of the result-set to which this query is a reference, if and only if the entire query consists only of a result-set reference. If it's anything else, including a boolean combination of a result-set reference with something else, then null is returned instead.- Overrides:
getResultSetNamein classCQLNode- Returns:
- the name of the referenced result-set
-
toCQL
-
toPQF
Description copied from class:CQLNodeRenders a parse-tree into a Yaz-style PQF string. PQF, or Prefix Query Format, is a cryptic but powerful notation that can be trivially mapped, one-to-one, int Z39.50 Type-1 and Type-101 queries. A specification for the format can be found in Chapter 7 (Supporting Tools) of the YAZ manual.- Specified by:
toPQFin classCQLNode- Parameters:
config- APropertiesobject containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file,etc/pqf.properties, which see.- Returns:
- A String containing a PQF query equivalent to the parse-tree whose root is this node.
- Throws:
PQFTranslationException- If the parse-tree cannot be translated into PQF, for example because it contains a CQL relation that is not supported by the PQF configuration.
-
toType1BER
Description copied from class:CQLNodeRenders a parser-tree into a BER-endoded packet representing an equivalent Z39.50 Type-1 query. If you don't know what that means, then you don't need this method :-) This is useful primarily for SRW-to-Z39.50 gateways.- Specified by:
toType1BERin classCQLNode- Parameters:
config- APropertiesobject containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file,etc/pqf.properties, which see.- Returns:
- A byte array containing the BER packet.
- Throws:
PQFTranslationException- If the parse-tree cannot be translated into PQF, for example because it contains a CQL relation that is not supported by the PQF configuration.- See Also:
-