WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.xml.sax
Class RequestHandler

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--examples.xml.sax.RequestHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

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.
 void startDocument()
          Receives notification of the beginning of the XML document.
 void startElement(java.lang.String name, org.xml.sax.Attributes attrs)
          Receives notification of the start of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endElement, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, 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.helpers.DefaultHandler
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.helpers.DefaultHandler
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.
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.helpers.DefaultHandler
Parameters:
x - the parser exception that occurred
Throws:
org.xml.sax.SAXException - if an error occurred while receiving the original error

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.
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
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.Attributes 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.
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.