|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.crosswire.jsword.book.filter.thml.CustomHandler
public class CustomHandler
To convert SAX events into OSIS events.
This is based upon the THML reference page: http://www.ccel.org/ThML/ThML1.04.htm to work out what the tags meant.
The GNU Lesser General Public License for details.
Field Summary | |
---|---|
private Book |
book
The book being parsed. |
private Key |
key
The book being parsed. |
private org.jdom2.Element |
rootElement
When the document is parsed, this is the last element popped off the stack. |
private LinkedList<org.jdom2.Content> |
stack
The stack of elements that we have created |
private static Map<String,Tag> |
TAG_MAP
The known tag types |
Constructor Summary | |
---|---|
CustomHandler(Book book,
Key key)
Simple ctor |
Method Summary | |
---|---|
void |
characters(char[] data,
int offset,
int length)
|
void |
endElement(String uri,
String localname,
String qname)
|
org.jdom2.Element |
getRootElement()
|
private Tag |
getTag(String localname,
String qname)
|
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 |
---|
private org.jdom2.Element rootElement
private Book book
private Key key
private LinkedList<org.jdom2.Content> stack
private static final Map<String,Tag> TAG_MAP
Constructor Detail |
---|
public CustomHandler(Book book, Key key)
book
- the bookkey
- the keyMethod Detail |
---|
public void startElement(String uri, String localname, String qname, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void characters(char[] data, int offset, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
public void endElement(String uri, String localname, String qname)
endElement
in interface ContentHandler
endElement
in class DefaultHandler
public org.jdom2.Element getRootElement()
private Tag getTag(String localname, String qname)
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |