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 Node
mCurrentNode
-
Constructor Summary
Constructors Constructor Description OdfFileSaxHandler(Node rootNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endDocument()
void
endElement(String uri, String localName, String qName)
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.InputSource
resolveEntity(String publicId, String systemId)
protected void
setContextNode(Node node)
Expose the current node to JenaSink to for caching the parsed RDF triples.void
setSink(JenaSink sink)
Set the JenaSink object.void
startDocument()
void
startElement(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:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in 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:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classDefaultHandler
- Throws:
IOException
SAXException
-
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
-
-
-