Class FormattedWriter

java.lang.Object
org.apache.sis.internal.xml.StreamWriterDelegate
org.apache.sis.internal.storage.xml.stream.FormattedWriter
All Implemented Interfaces:
XMLStreamWriter

final class FormattedWriter extends StreamWriterDelegate
Adds indentation to a XML output.
Design note: an alternative approach would have been to provide startIdentation() and endIndentation() convenience methods in StaxStreamWriter, and let subclasses perform their own formatting. It would reduce the need to try to guess some formatting aspects (e.g. whether to format on a single line or not). However, that approach does not integrate very well with JAXB; the Marshaller.JAXB_FORMATTED_OUTPUT property seems to be ignored when marshalling a fragment using XMLStreamWriter. Even if that property was supported, there is no standard way as of JDK8 to tell to JAXB to begin the indentation at some level (for taking in account the indentation of the elements containing the fragment to marshal with JAXB).
Since:
0.8
Version:
0.8