WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.jms.messageformat
Class RequestHandler

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--examples.jms.messageformat.RequestHandler
All Implemented Interfaces:
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class RequestHandler
extends org.xml.sax.HandlerBase

This class extends HandlerBase and is used to handle events created as an XML document is parsed by a SAX compliant parser.

Author:
Copyright (c) 2002 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
RequestHandler()
          Default constructor.
 
Method Summary
 void characters(char[] buf, int offset, int len)
          Receives notification of character data inside an element.
 void endDocument()
          Receives notification of the end of the XML document.
 void endElement(java.lang.String name)
          Receives notification of the end of an element.
 void error(org.xml.sax.SAXParseException x)
          Receives notification of a recoverable parser error.
 java.util.Hashtable getData()
          Returns parsed data as a hashtable.
 void startDocument()
          Receives notification of the beginning of the XML document.
 void startElement(java.lang.String name, org.xml.sax.AttributeList attrs)
          Receives notification of the start of an element.
 
Methods inherited from class org.xml.sax.HandlerBase
fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandler

public RequestHandler()
Default constructor.
Method Detail

characters

public void characters(char[] buf,
                       int offset,
                       int len)
                throws org.xml.sax.SAXException
Receives notification of character data inside an element. Prints out characters to the shell from which you started the WebLogic server.
Overrides:
characters in class org.xml.sax.HandlerBase
Parameters:
buf - array of characters
offset - the start position in the character array
len - the number of characters to use from the array
Throws:
org.xml.sax.SAXException - if an error occurred while parsing the XML doc

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Receives notification of the end of the XML document. Prints a final message to the shell from which you started the WebLogic server.
Overrides:
endDocument in class org.xml.sax.HandlerBase
Throws:
org.xml.sax.SAXException - If an error occurred while parsing the XML doc

endElement

public void endElement(java.lang.String name)
                throws org.xml.sax.SAXException
Receives notification of the end of an element. Prints notice to the shell from which you started the WebLogic server.
Overrides:
endElement in class org.xml.sax.HandlerBase
Parameters:
name - the string name of the element
Throws:
org.xml.sax.SAXException - If an error occurred while parsing the XML doc

error

public void error(org.xml.sax.SAXParseException x)
           throws org.xml.sax.SAXException
Receives notification of a recoverable parser error.
Overrides:
error in class org.xml.sax.HandlerBase
Parameters:
x - the parser exception that occurred
Throws:
org.xml.sax.SAXException - if an error occurred while receiving the original error

getData

public java.util.Hashtable getData()
Returns parsed data as a hashtable.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Receives notification of the beginning of the XML document. Starts printing information to the shell from which you started the WebLogic server and starts a new trade hashtable to store trade information.
Overrides:
startDocument in class org.xml.sax.HandlerBase
Throws:
org.xml.sax.SAXException - If an error occurred starting to parse the XML doc

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList attrs)
                  throws org.xml.sax.SAXException
Receives notification of the start of an element. Prints out the name and value of the element, properly indented, to the shell from which you started the WebLogic server. Updates the trade hashtable with the trade information.
Overrides:
startElement in class org.xml.sax.HandlerBase
Parameters:
name - the string name of the element
attrs - the list of attributes of the element
Throws:
org.xml.sax.SAXException - if an error occurred while parsing the XML doc

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.