org.crosswire.jsword.book.filter.thml
Class CustomHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.crosswire.jsword.book.filter.thml.CustomHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class CustomHandler
extends DefaultHandler

To convert SAX events into OSIS events.

I used the THML ref page: http://www.ccel.org/ThML/ThML1.04.htm to work out what the tags meant.

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
private static Logger log
          The log stream
private  org.jdom.Element rootElement
          When the document is parsed, this is the last element popped off the stack.
private  LinkedList stack
          The stack of elements that we have created
private static Map TAG_MAP
          The known tag types
 
Constructor Summary
CustomHandler()
          Simple ctor
 
Method Summary
 void characters(char[] data, int offset, int length)
           
 void endElement(String uri, String localname, String qname)
           
 org.jdom.Element getRootElement()
           
 void startElement(String uri, String localname, String qname, Attributes attrs)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootElement

private org.jdom.Element rootElement
When the document is parsed, this is the last element popped off the stack.


stack

private LinkedList stack
The stack of elements that we have created


TAG_MAP

private static final Map TAG_MAP
The known tag types


log

private static final Logger log
The log stream

Constructor Detail

CustomHandler

public CustomHandler()
Simple ctor

Method Detail

startElement

public void startElement(String uri,
                         String localname,
                         String qname,
                         Attributes attrs)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

characters

public void characters(char[] data,
                       int offset,
                       int length)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler

endElement

public void endElement(String uri,
                       String localname,
                       String qname)
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler

getRootElement

public org.jdom.Element getRootElement()

Copyright ยจ 2003-2005