Package org.docx4j.openpackaging.parts
Class StAXHandlerAbstract
java.lang.Object
org.docx4j.openpackaging.parts.StAXHandlerAbstract
- All Implemented Interfaces:
StAXHandlerInterface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(XMLStreamReader xmlr, XMLStreamWriter xmlWriter) abstract voidhandleCharacters(XMLStreamReader xmlr, XMLStreamWriter writer) Implement this method; for an example, see VariableReplaceStAX samplevoidwrite(XMLStreamReader xmlr, XMLStreamWriter writer) This is designed to cater for the common case of replacing character content.
-
Constructor Details
-
StAXHandlerAbstract
public StAXHandlerAbstract()
-
-
Method Details
-
handleCharacters
public abstract void handleCharacters(XMLStreamReader xmlr, XMLStreamWriter writer) throws XMLStreamException Implement this method; for an example, see VariableReplaceStAX sample- Parameters:
xmlr-writer-- Throws:
XMLStreamException
-
handle
public void handle(XMLStreamReader xmlr, XMLStreamWriter xmlWriter) throws LocationAwareXMLStreamException, XMLStreamException - Specified by:
handlein interfaceStAXHandlerInterface- Throws:
LocationAwareXMLStreamExceptionXMLStreamException
-
write
This is designed to cater for the common case of replacing character content. Everything else is passed through unchanged. If you wanted to find say a w:tbl then handle it with JAXB, you'll need to override this method and handle START_ELEMENT and END_ELEMENT differently (keeping track of where you are, so they match).- Parameters:
xmlr-writer-- Throws:
XMLStreamException
-