© 2002 BEA Systems, Inc.


examples.e2e.common
Class QuoteParser

java.lang.Object
  |
  +--examples.e2e.common.QuoteParser

public class QuoteParser
extends java.lang.Object
implements org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler

QuoteParser is used to parse XML documents that correspond to the E2E_AggregatedQPAResponse DTD. The parser returns a java.util.List of PurchaseQuote objects on completion of parsing. By default this class does not validate the XML supplied via the org.xml.sax.InputSource. Setting the system property "samples.e2e.b2b.xml.validate" will cause this class (and POParser to validate the input XML.

See Also:
POParser, QuoteElement, PurchaseQuote

Field Summary
static java.lang.String EMPTY_STRING
           
static java.lang.String VALIDATION_PROP
          Setting this system property ("samples.e2e.b2b.xml.validate") to true will cause the parser to validate the XML during parsing.
 
Constructor Summary
QuoteParser(org.xml.sax.InputSource source)
          Constructs a parser with the supplied XML.
 
Method Summary
 void characters(char[] chars, int start, int length)
          Implementation of the org.xml.sax.ContentHandler interface.
 void endDocument()
          Implementation of the org.xml.sax.ContentHandler interface.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Implementation of the org.xml.sax.ContentHandler interface.
 void endPrefixMapping(java.lang.String prefix)
          Implementation of the org.xml.sax.ContentHandler interface.
 void error(org.xml.sax.SAXParseException e)
          Implementation of the org.xml.sax.ErrorHandler interface.
 void fatalError(org.xml.sax.SAXParseException e)
          Implementation of the org.xml.sax.ErrorHandler interface.
 void ignorableWhitespace(char[] chars, int start, int length)
          Implementation of the org.xml.sax.ContentHandler interface.
 java.util.List parse()
          Parse the XML supplied via the constructor and return a java.util.List or PurchaseQuote objects.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Implementation of the org.xml.sax.ContentHandler interface.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Implementation of the org.xml.sax.ContentHandler interface.
 void skippedEntity(java.lang.String name)
          Implementation of the org.xml.sax.ContentHandler interface.
 void startDocument()
          Implementation of the org.xml.sax.ContentHandler interface.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
          Implementation of the org.xml.sax.ContentHandler interface.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Implementation of the org.xml.sax.ContentHandler interface.
 void warning(org.xml.sax.SAXParseException e)
          Implementation of the org.xml.sax.ErrorHandler interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING

public static final java.lang.String EMPTY_STRING

VALIDATION_PROP

public static final java.lang.String VALIDATION_PROP
Setting this system property ("samples.e2e.b2b.xml.validate") to true will cause the parser to validate the XML during parsing.
Constructor Detail

QuoteParser

public QuoteParser(org.xml.sax.InputSource source)
Constructs a parser with the supplied XML.

Parameters:
source - XML org.xml.sax.InputSource.
Method Detail

parse

public java.util.List parse()
                     throws ParsingException
Parse the XML supplied via the constructor and return a java.util.List or PurchaseQuote objects. Settung the system property "samples.e2e.b2b.xml.validate" to true will cause the class to validate the XML during parsing.

Returns:
a list of objects or null if the org.xml.sax.InputSource supplied is null. The list returned may be empty.s

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
startElement in interface org.xml.sax.ContentHandler


characters

public void characters(char[] chars,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
characters in interface org.xml.sax.ContentHandler


endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
endElement in interface org.xml.sax.ContentHandler


ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler


processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler


setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler


skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler


startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
startDocument in interface org.xml.sax.ContentHandler


endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
endDocument in interface org.xml.sax.ContentHandler


startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler


endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ContentHandler interface.
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler


error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ErrorHandler interface.
Specified by:
error in interface org.xml.sax.ErrorHandler


fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ErrorHandler interface.
Specified by:
fatalError in interface org.xml.sax.ErrorHandler


warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Implementation of the org.xml.sax.ErrorHandler interface.
Specified by:
warning in interface org.xml.sax.ErrorHandler


© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved