|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
se.biltmore.tools.odttoapt.maven.plugin.OdtSAXHandler
public class OdtSAXHandler
This handles the relevant SAX events from the SAX parser for extracting information from the odt content.xml file. It builds up a structure of APT models following the structure of the xml document, but producing output of an APT document.
Do getDocument() after parsing is done.
| Nested Class Summary | |
|---|---|
private static class |
OdtSAXHandler.Current
This represents what is currently being parsed. |
| Field Summary | |
|---|---|
private OdtSAXHandler.Current |
current
The currently parsed part. |
private APTDocument |
document
The APT document we will be populating. |
private ImageHandler |
imageHandler
The image handler to use for extracting images. |
private Stack<OdtSAXHandler.Current> |
parseStack
The parse stack. |
private Map<String,String> |
styleExtensions
Holds any received style extensions. |
| Constructor Summary | |
|---|---|
OdtSAXHandler(ImageHandler imageHandler)
Creates a new OdtSAXHandler instance. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Any text event. |
void |
endElement(String uri,
String localName,
String qName)
The end element event. |
private String |
getBaseStyle(String style)
Looks through all style extensions and returns the base style. |
APTDocument |
getDocument()
Returns the populated document. |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
The start element event. |
| 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 APTDocument document
private Stack<OdtSAXHandler.Current> parseStack
private OdtSAXHandler.Current current
private ImageHandler imageHandler
private Map<String,String> styleExtensions
| Constructor Detail |
|---|
public OdtSAXHandler(ImageHandler imageHandler)
imageHandler - The image handler to delegate to for found images.| Method Detail |
|---|
public APTDocument getDocument()
private String getBaseStyle(String style)
style -
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandleruri - Seems to be blank!localName - Seems to be blank!qName - The fully qualified element name.attributes - The element attributes.
SAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerch - An array of text characters.start - The staring point in the character array.length - The amount of valid character in the array.
SAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandleruri - Seems to be blank!localName - Seems to be blank!qName - The fully qualified element name.
SAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||