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