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 gen)
Implements tools. Method called after array start marker has been output, and right before the first value is to be output. |
| public void | beforeObjectEntries(JsonGenerator gen)
Implements tools. Method called after object start marker has been output, and right before the Name of the first property is to be output. |
| public DefaultXmlPrettyPrinter | createInstance()
Implements tools. 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 gen)
Implements tools. Method called after an array value has been completely output, and before another value is to be output. |
| public void | writeEndArray(JsonGenerator gen, int nrOfValues)
Implements tools. Method called after an Array value has been completely output (minus closing bracket). |
| public void | writeEndElement(XMLStreamWriter2 sw, int nrOfEntries)
Implements tools. Method for forcibly writing an end element, without going through Jackson generator (and thus, without updating currently active element stack) |
| public void | writeEndObject(JsonGenerator gen, int nrOfEntries)
Implements tools. 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 tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, char[] buffer, int offset, int len, boolean isCData)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, boolean value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, int value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, long value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, double value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, float value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigInteger value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigDecimal value)
Implements tools.
|
| public void | writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, Base64Variant base64variant, byte[] data, int offset, int len)
Implements tools.
|
| public void | writeLeafNullElement(XMLStreamWriter2 sw, String nsURI, String localName)
Implements tools.
|
| public void | writeLeafXsiNilElement(XMLStreamWriter2 sw, String nsURI, String localName)
Implements tools.
|
| public void | writeObjectEntrySeparator(JsonGenerator gen)
Implements tools. Method called after an Object entry (field:value) has been completely output, and before another value is to be output. |
| public void | writeObjectNameValueSeparator(JsonGenerator gen)
Implements tools. Method called after an Object property name has been output, but before the value is output. |
| public void | writePrologLinefeed(XMLStreamWriter2 sw)
Implements tools. 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 gen)
Implements tools. Method called after a root-level value has been completely output, and before another value is to be output. |
| public void | writeStartArray(JsonGenerator gen)
Implements tools. 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 tools. Method for forcibly writing a start element, without going through Jackson generator (and thus, without updating currently active element stack) |
| public void | writeStartObject(JsonGenerator gen)
Implements tools. Method called when an Object value is to be output, before any fields are output. |
| _arrayIndenter | back to summary |
|---|---|
| protected DefaultXmlPrettyPrinter. By default, let's use only spaces to separate array values. | |
| _justHadStartElement | back to summary |
|---|---|
| protected transient boolean _justHadStartElement Marker flag set on start element, and cleared if an end element is encountered. Used for suppressing indentation to allow empty elements.
| |
| _nesting | back to summary |
|---|---|
| protected transient int _nesting Number of open levels of nesting. Used to determine amount of indentation to use. | |
| _newLine | back to summary |
|---|---|
| protected String _newLine | |
| _objectIndenter | back to summary |
|---|---|
| protected DefaultXmlPrettyPrinter. By default, let's use linefeed-adding indenter for separate object entries. We'll further configure indenter to use system-specific linefeeds, and 2 spaces per level (as opposed to, say, single tabs) | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SPACE_COUNT | back to summary |
|---|---|
| pack-priv static final int SPACE_COUNT | |
| SPACES | back to summary |
|---|---|
| pack-priv static final char[] SPACES | |
| SYSTEM_DEFAULT_NEW_LINE | back to summary |
|---|---|
| private static final String SYSTEM_DEFAULT_NEW_LINE By default, will try to set as System.getProperty("line.separator"). Can later set custom new line with withCustomNewLine method.
| |
| DefaultXmlPrettyPrinter | back to summary |
|---|---|
| public DefaultXmlPrettyPrinter() | |
| DefaultXmlPrettyPrinter | back to summary |
|---|---|
| protected DefaultXmlPrettyPrinter(DefaultXmlPrettyPrinter base) | |
| beforeArrayValues | back to summary |
|---|---|
| public void beforeArrayValues(JsonGenerator gen) Implements tools. Doc from tools. Method called after array start marker has been output, and right before the first value is to be output. It is not called for arrays with no values. Default handling does not output anything, but pretty-printer is free to add any white space decoration.
| |
| beforeObjectEntries | back to summary |
|---|---|
| public void beforeObjectEntries(JsonGenerator gen) Implements tools. Doc from tools. Method called after object start marker has been output, and right before the Name of the first property is to be output. It is not called for objects without properties. Default handling does not output anything, but pretty-printer is free to add any white space decoration.
| |
| createInstance | back to summary |
|---|---|
| public DefaultXmlPrettyPrinter createInstance() Implements tools. Doc from tools. 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.
| |
| indentArraysWith | back to summary |
|---|---|
| public void indentArraysWith(DefaultXmlPrettyPrinter. | |
| indentObjectsWith | back to summary |
|---|---|
| public void indentObjectsWith(DefaultXmlPrettyPrinter. | |
| withCustomNewLine | back to summary |
|---|---|
| public DefaultXmlPrettyPrinter withCustomNewLine(String newLine) Sets custom new-line.
| |
| writeArrayValueSeparator | back to summary |
|---|---|
| public void writeArrayValueSeparator(JsonGenerator gen) Implements tools. Doc from tools. Method called after an array value has been completely output, and before another value is to be output. Default handling (without pretty-printing) will output a single comma to separate the two. Pretty-printer is to output a comma as well, but can surround that with other (white-space) decoration.
| |
| writeEndArray | back to summary |
|---|---|
| public void writeEndArray(JsonGenerator gen, int nrOfValues) Implements tools. Doc from tools. Method called after an Array value has been completely output (minus closing bracket). Default handling (without pretty-printing) will output the closing bracket. Pretty-printer is to output a bracket as well, but can surround that with other (white-space) decoration.
| |
| writeEndElement | back to summary |
|---|---|
| public void writeEndElement(XMLStreamWriter2 sw, int nrOfEntries) throws XMLStreamException Implements tools. Doc from tools. Method for forcibly writing an end element, without going through Jackson generator (and thus, without updating currently active element stack)
| |
| writeEndObject | back to summary |
|---|---|
| public void writeEndObject(JsonGenerator gen, int nrOfEntries) throws JacksonException Implements tools. Doc from tools. Method called after an Object value has been completely output (minus closing curly bracket). Default handling (without pretty-printing) will output the closing curly bracket. Pretty-printer is to output a curly bracket as well, but can surround that with other (white-space) decoration.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, String text, boolean isCData) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, char[] buffer, int offset, int len, boolean isCData) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, boolean value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, int value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, long value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, double value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, float value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigInteger value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, BigDecimal value) throws XMLStreamException Implements tools.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLStreamWriter2 sw, String nsURI, String localName, Base64Variant base64variant, byte[] data, int offset, int len) throws XMLStreamException Implements tools.
| |
| writeLeafNullElement | back to summary |
|---|---|
| public void writeLeafNullElement(XMLStreamWriter2 sw, String nsURI, String localName) throws XMLStreamException Implements tools.
| |
| writeLeafXsiNilElement | back to summary |
|---|---|
| public void writeLeafXsiNilElement(XMLStreamWriter2 sw, String nsURI, String localName) throws XMLStreamException Implements tools.
| |
| writeObjectEntrySeparator | back to summary |
|---|---|
| public void writeObjectEntrySeparator(JsonGenerator gen) throws JacksonException Implements tools. Doc from tools. Method called after an Object entry (field:value) has been completely output, and before another value is to be output. Default handling (without pretty-printing) will output a single comma to separate the two. Pretty-printer is to output a comma as well, but can surround that with other (white-space) decoration.
| |
| writeObjectNameValueSeparator | back to summary |
|---|---|
| public void writeObjectNameValueSeparator(JsonGenerator gen) throws JacksonException Implements tools. Doc from tools. Method called after an Object property name has been output, but before the value is output. Default handling (without pretty-printing) will output a single colon to separate the two. Pretty-printer is to output a colon as well, but can surround that with other (white-space) decoration.
| |
| writePrologLinefeed | back to summary |
|---|---|
| public void writePrologLinefeed(XMLStreamWriter2 sw) throws XMLStreamException Implements tools. Doc from tools. 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.
| |
| writeRootValueSeparator | back to summary |
|---|---|
| public void writeRootValueSeparator(JsonGenerator gen) Implements tools. Doc from tools. Method called after a root-level value has been completely output, and before another value is to be output. Default handling (without pretty-printing) will output a space, to allow values to be parsed correctly. Pretty-printer is to output some other suitable and nice-looking separator (tab(s), space(s), linefeed(s) or any combination thereof).
| |
| writeStartArray | back to summary |
|---|---|
| public void writeStartArray(JsonGenerator gen) Implements tools. Doc from tools. Method called when an Array value is to be output, before any member/child values are output. Default handling (without pretty-printing) will output the opening bracket. Pretty-printer is to output a bracket as well, but can surround that with other (white-space) decoration.
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(XMLStreamWriter2 sw, String nsURI, String localName) throws XMLStreamException Implements tools. Doc from tools. Method for forcibly writing a start element, without going through Jackson generator (and thus, without updating currently active element stack)
| |
| writeStartObject | back to summary |
|---|---|
| public void writeStartObject(JsonGenerator gen) throws JacksonException Implements tools. Doc from tools. Method called when an Object value is to be output, before any fields are output. Default handling (without pretty-printing) will output the opening curly bracket. Pretty-printer is to output a curly bracket as well, but can surround that with other (white-space) decoration.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| FixedSpaceIndenter | back to summary |
|---|---|
| public FixedSpaceIndenter() | |
| isInline | back to summary |
|---|---|
| public boolean isInline() Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(XMLStreamWriter2 sw, int level) throws XMLStreamException Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(JsonGenerator g, int level) throws JacksonException Implements tools.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public void |
| isInline | back to summary |
|---|---|
public boolean isInline()
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(JsonGenerator g, int level) throws JacksonException | |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(XMLStreamWriter2 sw, int level) throws XMLStreamException | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| Lf2SpacesIndenter | back to summary |
|---|---|
| public Lf2SpacesIndenter() | |
| isInline | back to summary |
|---|---|
| public boolean isInline() Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(XMLStreamWriter2 sw, int level) throws XMLStreamException Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(JsonGenerator g, int level) throws JacksonException Implements tools.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | writeIndentation(JsonGenerator jg, int level)
Implements tools.
|
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NopIndenter | back to summary |
|---|---|
| public NopIndenter() | |
| isInline | back to summary |
|---|---|
| public boolean isInline() Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(JsonGenerator jg, int level) Implements tools.
| |
| writeIndentation | back to summary |
|---|---|
| public void writeIndentation(XMLStreamWriter2 sw, int level) Implements tools.
| |