This class provides a concrete implementation of {@link StAXStreamProcessor}for supporting the {@link StAXStreamOutputter}.
Overview
This class is marked abstract even though all methods are fully implemented. The process*(...)
methods are public because they match the StAXStreamProcessor interface but the remaining methods are all protected.
People who want to create a custom StAXStreamProcessor for StAXStreamOutputter are able to extend this class and modify any functionality they want. Before sub-classing this you should first check to see if the {@link Format} classcan get you the results you want.
Subclasses of this should have reentrant methods. This is easiest to accomplish simply by not allowing any instance fields. If your sub-class has an instance field/variable, then it's probably broken.
The Stacks
One significant feature of this implementation is that it creates and maintains both a {@link NamespaceStack} and {@link FormatStack} that aremanaged in the {@link #printElement(XMLStreamWriter,FormatStack,NamespaceStack,Element)} method.The stacks are pushed and popped in that method only. They significantly improve the performance and readability of the code.
The NamespaceStack is only sent through to the {@link #printElement(XMLStreamWriter,FormatStack,NamespaceStack,Element)} and{@link #printContent(XMLStreamWriter,FormatStack,NamespaceStack,Walker)} methods, butthe FormatStack is pushed through to all print* Methods.
@see StAXStreamOutputter
@see StAXStreamProcessor
@since JDOM2
@author Rolf Lear