edu.ucsb.nceas.metacat
Class QuerySpecification

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--edu.ucsb.nceas.metacat.QuerySpecification

public class QuerySpecification
extends org.xml.sax.HandlerBase

A Class that represents a structured query, and can be constructed from an XML serialization conforming to @see pathquery.dtd. The printSQL() method can be used to print a SQL serialization of the query.


Constructor Summary
QuerySpecification(java.io.Reader queryspec, java.lang.String parserName)
          construct an instance of the QuerySpecification class
QuerySpecification(java.lang.String queryspec, java.lang.String parserName)
          construct an instance of the QuerySpecification class
 
Method Summary
 void characters(char[] ch, int start, int length)
          callback method used by the SAX Parser when the text sequences of an xml stream are detected.
 void endElement(java.lang.String name)
          callback method used by the SAX Parser when the end tag of an element is detected.
static void main(java.lang.String[] args)
          Main routine for testing
 java.lang.String printSQL()
          create a SQL serialization of the query that this instance represents
 void startElement(java.lang.String name, org.xml.sax.AttributeList atts)
          callback method used by the SAX Parser when the start tag of an element is detected.
 java.lang.String toString()
          create a String description of the query that this instance represents.
 
Methods inherited from class org.xml.sax.HandlerBase
endDocument, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuerySpecification

public QuerySpecification(java.io.Reader queryspec,
                          java.lang.String parserName)
                   throws java.io.IOException
construct an instance of the QuerySpecification class
Parameters:
queryspec - the XML representation of the query (should conform to pathquery.dtd) as a Reader
parserName - the fully qualified name of a Java Class implementing the org.xml.sax.Parser interface

QuerySpecification

public QuerySpecification(java.lang.String queryspec,
                          java.lang.String parserName)
                   throws java.io.IOException
construct an instance of the QuerySpecification class
Parameters:
queryspec - the XML representation of the query (should conform to pathquery.dtd) as a String
parserName - the fully qualified name of a Java Class implementing the org.xml.sax.Parser interface
Method Detail

main

public static void main(java.lang.String[] args)
Main routine for testing

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList atts)
                  throws org.xml.sax.SAXException
callback method used by the SAX Parser when the start tag of an element is detected. Used in this context to parse and store the query information in class variables.
Overrides:
startElement in class org.xml.sax.HandlerBase

endElement

public void endElement(java.lang.String name)
                throws org.xml.sax.SAXException
callback method used by the SAX Parser when the end tag of an element is detected. Used in this context to parse and store the query information in class variables.
Overrides:
endElement in class org.xml.sax.HandlerBase

characters

public void characters(char[] ch,
                       int start,
                       int length)
callback method used by the SAX Parser when the text sequences of an xml stream are detected. Used in this context to parse and store the query information in class variables.
Overrides:
characters in class org.xml.sax.HandlerBase

printSQL

public java.lang.String printSQL()
create a SQL serialization of the query that this instance represents

toString

public java.lang.String toString()
create a String description of the query that this instance represents. This should become a way to get the XML serialization of the query.
Overrides:
toString in class java.lang.Object


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.