Rename the toType1() method to the more explicit toType1BER()
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLNode.java
index 200776f..1eae518 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: CQLNode.java,v 1.16 2002-12-04 16:56:06 mike Exp $
+// $Id: CQLNode.java,v 1.20 2002-12-11 17:14:20 mike Exp $
 
 package org.z3950.zing.cql;
 import java.util.Properties;
@@ -8,7 +8,7 @@ import java.util.Vector;
 /**
  * Represents a node in a CQL parse-tree.
  *
- * @version    $Id: CQLNode.java,v 1.16 2002-12-04 16:56:06 mike Exp $
+ * @version    $Id: CQLNode.java,v 1.20 2002-12-11 17:14:20 mike Exp $
  */
 public abstract class CQLNode {
     CQLNode() {}               // prevent javadoc from documenting this
@@ -71,13 +71,12 @@ public abstract class CQLNode {
      * A <TT>Properties</TT> object containing configuration
      * information that specifies the mapping from CQL qualifiers,
      * relations, etc. to Type-1 attributes.  The mapping
-     * specification is described in the cql-java distribution's
+     * specification is described in the CQL-Java distribution's
      * sample PQF-mapping configuration file,
      * <TT>etc/pqf.properties</TT>, which see.
      * @return
      * A String containing a PQF query equivalent to the parse-tree
-     * whose root is this node.  This may be fed into the tool of
-     * your choice to obtain a BER-encoded packet.
+     * whose root is this node.
      */
     abstract public String toPQF(Properties config)
        throws PQFTranslationException;
@@ -95,9 +94,25 @@ public abstract class CQLNode {
     protected static String xq(String str) { return Utils.xq(str); }
 
     /**
-     * ### Document this!
+     * Renders 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.
+     *
+     * @param config
+     * A <TT>Properties</TT> object containing configuration
+     * information that specifies the mapping from CQL qualifiers,
+     * relations, etc. to Type-1 attributes.  The mapping
+     * specification is described in the CQL-Java distribution's
+     * sample PQF-mapping configuration file,
+     * <TT>etc/pqf.properties</TT>, which see.
+     * @return
+     * A byte array containing the BER packet.
+     * @see
+     * <A href="ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc"
+     *         >ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc</A>
      */
-    abstract public byte[] toType1(Properties config)
+    abstract public byte[] toType1BER(Properties config)
        throws PQFTranslationException;
 
     // ANS.1 classes
@@ -289,7 +304,7 @@ public abstract class CQLNode {
 
     public static final byte[] makeQuery(CQLNode root, Properties properties)
        throws PQFTranslationException {
-        byte[] rpnStructure = root.toType1(properties);
+        byte[] rpnStructure = root.toType1BER(properties);
         byte[] qry = new byte[rpnStructure.length+100];
         int offset = 0;
         offset = putTag(CONTEXT, 1, CONSTRUCTED, qry, offset);