com.mkdoc.sax
Class AbstractContentHandler

java.lang.Object
  |
  +--com.mkdoc.sax.AbstractContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler
Direct Known Subclasses:
AbstractRdfContentHandler

public abstract class AbstractContentHandler
extends java.lang.Object
implements org.xml.sax.ContentHandler

An inert base implementation of a ContentHandler.

Subclasses must implement startElement and endElement.

Version:
0.2 2005-09-09
Author:
Philip Shaw

Field Summary
protected  org.xml.sax.Locator locator
          The locator for this parse.
 
Constructor Summary
AbstractContentHandler()
           
 
Method Summary
 void characters(char[] charArray, int start, int length)
          Process character content.
 void endDocument()
          Process the end document event.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Process the end element event.
 void endPrefixMapping(java.lang.String prefix)
          Process the end prefix mapping event.
protected  java.lang.String getAttributeValue(org.xml.sax.Attributes attributes, int index)
          Get a single attribute value from a set of attributes.
 void ignorableWhitespace(char[] charArray, int start, int length)
          Process ignorable whitespace.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Handle a processing instruction.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Set a Locator object for a parse.
 void skippedEntity(java.lang.String name)
          Process a skipped entity.
 void startDocument()
          Process the start document event.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Process the start element event.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Process the start prefix mapping event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locator

protected org.xml.sax.Locator locator
The locator for this parse.

Since:
Version 0.1 2004-12-10
Constructor Detail

AbstractContentHandler

public AbstractContentHandler()
Method Detail

setDocumentLocator

public final void setDocumentLocator(org.xml.sax.Locator locator)
Set a Locator object for a parse.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Parameters:
locator - The locator to use.
Since:
Version 0.1 2004-12-10

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Process the start document event.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Process the end document event.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Process the start prefix mapping event.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - The namespace prefix to map.
uri - The namespace URI to alias.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Process the end prefix mapping event.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - The namespace prefix that was being mapped.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Process the start element event.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
uri - The namespace URI for the element.
localName - The local element name.
qName - The qualified element name.
atts - A set of attributes.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Process the end element event.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
uri - The namespace URI for the element.
localName - The local element name.
qName - The qualified element name.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

characters

public void characters(char[] charArray,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Process character content.

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
charArray - The character array to process.
start - The start index of the characters.
length - The number of characters to read.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

ignorableWhitespace

public void ignorableWhitespace(char[] charArray,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Process ignorable whitespace.

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
charArray - The character array to process.
start - The start index of the characters.
length - The number of characters to read.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Handle a processing instruction.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Parameters:
target - The target application identifier.
data - The data to pass to the application.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Process a skipped entity.

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Parameters:
name - The name of the skipped entity.
Throws:
org.xml.sax.SAXException - Never thrown by this implementation.
Since:
Version 0.1 2004-12-10

getAttributeValue

protected final java.lang.String getAttributeValue(org.xml.sax.Attributes attributes,
                                                   int index)
Get a single attribute value from a set of attributes.

Parameters:
attributes - The attribute set from which to extract the value.
index - The index of the attribute to get.
Returns:
A trimmed string of the specified attribute value or null if out of range.
Since:
Version 0.2 2005-09-09