All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.microstar.xml.HandlerBase

java.lang.Object
   |
   +----com.microstar.xml.HandlerBase

public class HandlerBase
extends Object
implements XmlHandler
Convenience base class for AElfred handlers.

This base class implements the XmlHandler interface with (mostly empty) default handlers. You are not required to use this, but if you need to handle only a few events, you might find it convenient to extend this class rather than implementing the entire interface. This example overrides only the charData method, using the defaults for the others:

 import com.microstar.xml.HandlerBase;
 public class MyHandler extends HandlerBase {
   public void charData (char ch[], int start, int length)
   {
     System.out.println("Data: " + new String (ch, start, length));
   }
 }
 

This class is optional, but if you use it, you must also include the XmlException class.

Do not extend this if you are using SAX; extend org.xml.sax.HandlerBase instead.

Version:
1.1
Author:
Copyright (c) 1998 by Microstar Software Ltd., written by David Megginson <dmeggins@microstar.com>
See Also:
XmlHandler, XmlException, HandlerBase

Constructor Index

 o HandlerBase()

Method Index

 o attribute(String, String, boolean)
Handle an attribute assignment.
 o charData(char[], int, int)
Handle character data.
 o doctypeDecl(String, String, String)
Handle a document type declaration.
 o endDocument()
Handle the end of the document.
 o endElement(String)
Handle the end of an element.
 o endExternalEntity(String)
Handle the end of an external entity.
 o error(String, String, int, int)
Throw an exception for a fatal error.
 o ignorableWhitespace(char[], int, int)
Handle ignorable whitespace.
 o processingInstruction(String, String)
Handle a processing instruction.
 o resolveEntity(String, String)
Resolve an external entity.
 o startDocument()
Handle the start of the document.
 o startElement(String)
Handle the start of an element.
 o startExternalEntity(String)
Handle the start of an external entity.

Constructors

 o HandlerBase
 public HandlerBase()

Methods

 o startDocument
 public void startDocument() throws Exception
Handle the start of the document.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
startDocument
 o endDocument
 public void endDocument() throws Exception
Handle the end of the document.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
endDocument
 o resolveEntity
 public Object resolveEntity(String publicId,
                             String systemId) throws Exception
Resolve an external entity.

The default implementation simply returns the supplied system identifier.

Throws: Exception
Derived methods may throw exceptions.
See Also:
resolveEntity
 o startExternalEntity
 public void startExternalEntity(String systemId) throws Exception
Handle the start of an external entity.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
startExternalEntity
 o endExternalEntity
 public void endExternalEntity(String systemId) throws Exception
Handle the end of an external entity.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
endExternalEntity
 o doctypeDecl
 public void doctypeDecl(String name,
                         String publicId,
                         String systemId) throws Exception
Handle a document type declaration.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
doctypeDecl
 o attribute
 public void attribute(String aname,
                       String value,
                       boolean isSpecified) throws Exception
Handle an attribute assignment.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
attribute
 o startElement
 public void startElement(String elname) throws Exception
Handle the start of an element.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
startElement
 o endElement
 public void endElement(String elname) throws Exception
Handle the end of an element.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
endElement
 o charData
 public void charData(char ch[],
                      int start,
                      int length) throws Exception
Handle character data.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
charData
 o ignorableWhitespace
 public void ignorableWhitespace(char ch[],
                                 int start,
                                 int length) throws Exception
Handle ignorable whitespace.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
ignorableWhitespace
 o processingInstruction
 public void processingInstruction(String target,
                                   String data) throws Exception
Handle a processing instruction.

The default implementation does nothing.

Throws: Exception
Derived methods may throw exceptions.
See Also:
processingInstruction
 o error
 public void error(String message,
                   String systemId,
                   int line,
                   int column) throws XmlException, Exception
Throw an exception for a fatal error.

The default implementation throws XmlException.

Throws: XmlException
A specific parsing error.
Throws: Exception
Derived methods may throw exceptions.
See Also:
error

All Packages  Class Hierarchy  This Package  Previous  Next  Index