uk.org.ogsadai.converters.webrowset
Class WebRowSetParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--uk.org.ogsadai.converters.webrowset.WebRowSetParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class WebRowSetParser
extends org.xml.sax.helpers.DefaultHandler

This class parses a WebRowSet XML document, pushing the parsed results into a WebRowSetHandler.

Author:
The OGSA-DAI Team.
See Also:
WebRowSetHandler, ColumnMetaData, TypeStrategy

Nested Class Summary
private  class WebRowSetParser.DataHandler
          A handler for the data element of a WebRowSet.
private  class WebRowSetParser.MetaDataHandler
          A handler for the metadata element of a WebRowSet.
private  class WebRowSetParser.PropertiesHandler
          A handler for the properties element of a WebRowSet.
 
Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  ElementHandler mHandler
           
private  org.xml.sax.InputSource mInput
           
private  org.xml.sax.Locator mLocator
           
private  WebRowSetHandler mOutput
           
private  javax.xml.parsers.SAXParser mParser
           
 
Constructor Summary
WebRowSetParser()
          Constructs a new WebRowSetParser
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 void parse()
          Starts parsing the XML WebRowSet.
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void setInput(java.io.Reader reader)
          Set the input source of the parser that provides the WebRowSet XML.
 void setOutput(WebRowSetHandler handler)
          Set the WebRowSetHandler which handles the parsed data.
 void setParsingStrategy(ElementHandler strategy)
          The current strategy to use when parsing the data.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mParser

private javax.xml.parsers.SAXParser mParser

mInput

private org.xml.sax.InputSource mInput

mOutput

private WebRowSetHandler mOutput

mHandler

private ElementHandler mHandler

mLocator

private org.xml.sax.Locator mLocator
Constructor Detail

WebRowSetParser

public WebRowSetParser()
                throws ExternalModuleException
Constructs a new WebRowSetParser

Throws:
ExternalModuleException - if there was a problem setting up the parser.
Method Detail

setInput

public void setInput(java.io.Reader reader)
Set the input source of the parser that provides the WebRowSet XML.

Parameters:
reader - WebRowSet data source.

setOutput

public void setOutput(WebRowSetHandler handler)
Set the WebRowSetHandler which handles the parsed data.

Parameters:
handler - Handler parsed data.

setParsingStrategy

public void setParsingStrategy(ElementHandler strategy)
The current strategy to use when parsing the data.

Parameters:
strategy - A parsing strategy.

parse

public void parse()
           throws org.xml.sax.SAXException,
                  java.io.IOException
Starts parsing the XML WebRowSet.

Throws:
org.xml.sax.SAXException - if a parsing problem occurred.
java.io.IOException - if there was a problem reading from the input source.

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attr)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException