Class SdtStAXHandler
java.lang.Object
org.docx4j.openpackaging.parts.StAXHandlerAbstract
org.docx4j.openpackaging.parts.WordprocessingML.SdtStAXHandler
- All Implemented Interfaces:
StAXHandlerInterface
A framework for using StAX to find SDT elements, then using JAXB to manipulate them.
- Since:
- 11.5.3
- Author:
- jharrop
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic jakarta.xml.bind.JAXBContextprotected SdtStAXHandler.Stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(XMLStreamReader xsr, XMLStreamWriter xmlWriter) voidhandleCharacters(XMLStreamReader xmlr, XMLStreamWriter writer) Implement this method; for an example, see VariableReplaceStAX samplehandleSdt(SdtElement sdt) Manipulate the SDT as you wish.Methods inherited from class org.docx4j.openpackaging.parts.StAXHandlerAbstract
write
-
Field Details
-
context
public static jakarta.xml.bind.JAXBContext context -
stack
-
-
Constructor Details
-
SdtStAXHandler
public SdtStAXHandler()
-
-
Method Details
-
handleSdt
Manipulate the SDT as you wish.- Parameters:
sdt-- Throws:
Docx4JException
-
handle
public void handle(XMLStreamReader xsr, XMLStreamWriter xmlWriter) throws LocationAwareXMLStreamException, XMLStreamException - Specified by:
handlein interfaceStAXHandlerInterface- Overrides:
handlein classStAXHandlerAbstract- Throws:
LocationAwareXMLStreamExceptionXMLStreamException
-
handleCharacters
public void handleCharacters(XMLStreamReader xmlr, XMLStreamWriter writer) throws XMLStreamException Description copied from class:StAXHandlerAbstractImplement this method; for an example, see VariableReplaceStAX sample- Specified by:
handleCharactersin classStAXHandlerAbstract- Throws:
XMLStreamException
-