Package org.odftoolkit.odfdom.pkg
Class OdfFileSaxHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.odftoolkit.odfdom.pkg.OdfFileSaxHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
ChangesFileSaxHandler
public class OdfFileSaxHandler extends DefaultHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected NodemCurrentNode
-
Constructor Summary
Constructors Constructor Description OdfFileSaxHandler(Node rootNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(String uri, String localName, String qName)protected voidflushTextNode()http://xerces.apache.org/xerces2-j/faq-sax.html#faq-2 : SAX may deliver contiguous text as multiple calls to characters, for reasons having to do with parser efficiency and input buffering.InputSourceresolveEntity(String publicId, String systemId)protected voidsetContextNode(Node node)Expose the current node to JenaSink to for caching the parsed RDF triples.voidsetSink(JenaSink sink)Set the JenaSink object.voidstartDocument()voidstartElement(String uri, String localName, String qName, Attributes attributes)-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
mCurrentNode
protected Node mCurrentNode
-
-
Constructor Detail
-
OdfFileSaxHandler
public OdfFileSaxHandler(Node rootNode) throws SAXException
- Throws:
SAXException
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
flushTextNode
protected void flushTextNode()
http://xerces.apache.org/xerces2-j/faq-sax.html#faq-2 : SAX may deliver contiguous text as multiple calls to characters, for reasons having to do with parser efficiency and input buffering. It is the programmer's responsibility to deal with that appropriately, e.g. by accumulating text until the next non-characters event.
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Throws:
IOExceptionSAXException
-
setContextNode
protected void setContextNode(Node node)
Expose the current node to JenaSink to for caching the parsed RDF triples.
-
setSink
public void setSink(JenaSink sink)
Set the JenaSink object.- Parameters:
sink-
-
-