public class CustomHandler extends DefaultHandler
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.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
CustomHandler(Book book,
Key key)
Simple ctor
|
| Modifier and Type | Method and Description |
|---|---|
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) |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningprivate org.jdom2.Element rootElement
private Book book
private Key key
private LinkedList<org.jdom2.Content> stack
public void startElement(String uri, String localname, String qname, Attributes attrs) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void characters(char[] data,
int offset,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerpublic void endElement(String uri, String localname, String qname)
endElement in interface ContentHandlerendElement in class DefaultHandlerpublic org.jdom2.Element getRootElement()