Note that only a subset of methods of PrettyPrinter actually
get called by ToXmlGenerator; because of this, implementation
is bit briefer (and uglier...).
| Modifier and Type | Class and Description |
|---|---|
| protected static class | DefaultXmlPrettyPrinter.
This is a very simple indenter that only every adds a single space for indentation. |
| public static interface | DefaultXmlPrettyPrinter.
Interface that defines objects that can produce indentation used to separate object entries and array values. |
| protected class | DefaultXmlPrettyPrinter.
Default linefeed-based indenter uses system-specific linefeeds and 2 spaces for indentation per level. |
| protected static class | DefaultXmlPrettyPrinter.
Dummy implementation that adds no indentation whatsoever |
| Modifier and Type | Field and Description |
|---|---|
| protected DefaultXmlPrettyPrinter. | _arrayIndenter
By default, let's use only spaces to separate array values. |
| protected transient boolean | _justHadStartElement
Marker flag set on start element, and cleared if an end element is encountered. |
| protected transient int | _nesting
Number of open levels of nesting. |
| protected String | |
| protected DefaultXmlPrettyPrinter. | _objectIndenter
By default, let's use linefeed-adding indenter for separate object entries. |
| private static final long | |
| pack-priv static final int | |
| pack-priv static final char[] | |
| private static final String | SYSTEM_DEFAULT_NEW_LINE
By default, will try to set as System.getProperty("line.separator"). |
| Access | Constructor and Description |
|---|---|
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | beforeArrayValues(JsonGenerator
Generator used for output gen)Implements com. Method called after array start marker has been output, and right before the first value is to be output. |
| public void | beforeObjectEntries(JsonGenerator
Generator used for output gen)Implements com. Method called after object start marker has been output, and right before the field name of the first entry is to be output. |
| public DefaultXmlPrettyPrinter | createInstance()
Implements com. Method called to ensure that we have a non-blueprint object to use; it is either this object (if stateless), or a newly created object with separate state. |
| public void | |
| public void | |
| public DefaultXmlPrettyPrinter | |
| public void | writeArrayValueSeparator(JsonGenerator
Generator used for output gen)Implements com. Method called after an array value has been completely output, and before another value is to be output. |
| public void | writeEndArray(JsonGenerator
Generator used for output gen, int Number of direct members of the array that
have been output nrOfValues)Implements com. Method called after an Array value has been completely output (minus closing bracket). |
| public void | writeEndElement(XMLStreamWriter2 sw, int nrOfEntries)
Implements com. Method for forcibly writing an end element, without going through Jackson generator (and thus, without updating currently active element stack) |
| public void | writeEndObject(JsonGenerator
Generator used for output gen, int Number of direct members of the Object that
have been output nrOfEntries)Implements com. Method called after an Object value has been completely output (minus closing curly bracket). |
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, String text, boolean isCData)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, char[] buffer, int offset, int len, boolean isCData)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, boolean value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, int value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, long value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, double value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, float value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigInteger value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigDecimal value)
Implements com.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, Base64Variant base64variant, byte[] data, int offset, int len)
Implements com.
|
| public void | writeLeafNullElement(XMLStreamWriter2 sw, String nsURI, String localName)
Implements com.
|
| public void | |
| public void | writeObjectEntrySeparator(JsonGenerator
Generator used for output gen)Implements com. Method called after an Object entry (field:value) has been completely output, and before another value is to be output. |
| public void | writeObjectFieldValueSeparator(JsonGenerator
Generator used for output gen)Implements com. Method called after an object field has been output, but before the value is output. |
| public void | writePrologLinefeed(XMLStreamWriter2 sw)
Implements com. Method for trying to write a linefeed to separate entities outside of the root element (that is, in prolog or epilog), most often called to separate XML declaration from the root element. |
| public void | writeRootValueSeparator(JsonGenerator
Generator used for output gen)Implements com. Method called after a root-level value has been completely output, and before another value is to be output. |
| public void | writeStartArray(JsonGenerator
Generator used for output gen)Implements com. Method called when an Array value is to be output, before any member/child values are output. |
| public void | writeStartElement(XMLStreamWriter2 sw, String nsURI, String localName)
Implements com. Method for forcibly writing a start element, without going through Jackson generator (and thus, without updating currently active element stack) |
| public void | writeStartObject(JsonGenerator
Generator used for output gen)Implements com. Method called when an Object value is to be output, before any fields are output. |