The details include;
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| private final XMLOutputFactory | |
| private volatile String | |
| private volatile boolean | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | XmlFormatter(final String
a string representation of a map to override keys keyOverrides)Creates a new XML formatter. |
| public | XmlFormatter(final Map<StructuredFormatter.
a map of overrides for the default keys keyOverridesCreates a new XML formatter. |
| Modifier and Type | Method and Description |
|---|---|
| protected StructuredFormatter. | createGenerator(final Writer writer)
Implements abstract org. Creates the generator used to create the structured data. |
| public String | Returns: the namespace URI, may benull if explicitly set to nullReturns the namespace URI used for each record if |
| public boolean | Returns: true if pretty printing is enabled, otherwise falseIndicates whether or not pretty printing is enabled. |
| public boolean | Returns: true if the name space should be written for each recordIndicates whether or not the name space should be written on the |
| public void | setNamespaceUri(final String
the namespace to use or namespaceUri)null if no namespace URI should be used regardless of the
isPrintNamespace() valueSets the namespace URI used for each record if |
| public void | setPrettyPrint(final boolean
true to turn on pretty printing or false to turn it offTurns on or off pretty printing. |
| public void | setPrintNamespace(final boolean
true if the name space should be written for each recordTurns on or off the printing of the namespace for each |
| DEFAULT_NAMESPACE | back to summary |
|---|---|
| public static final String DEFAULT_NAMESPACE | |
| factory | back to summary |
|---|---|
| private final XMLOutputFactory factory | |
| namespaceUri | back to summary |
|---|---|
| private volatile String namespaceUri | |
| prettyPrint | back to summary |
|---|---|
| private volatile boolean prettyPrint | |
| printNamespace | back to summary |
|---|---|
| private volatile boolean printNamespace | |
| XmlFormatter | back to summary |
|---|---|
| public XmlFormatter() Creates a new XML formatter. | |
| XmlFormatter | back to summary |
|---|---|
| public XmlFormatter(final String keyOverrides) Creates a new XML formatter.
If the
| |
| XmlFormatter | back to summary |
|---|---|
| public XmlFormatter(final Map<StructuredFormatter. Creates a new XML formatter.
If the
| |
| createGenerator | back to summary |
|---|---|
| protected StructuredFormatter. Implements abstract org. Doc from org. Creates the generator used to create the structured data.
| |
| getNamespaceUri | back to summary |
|---|---|
| public String getNamespaceUri() Returns the namespace URI used for each record if
| |
| isPrettyPrint | back to summary |
|---|---|
| public boolean isPrettyPrint() Indicates whether or not pretty printing is enabled.
| |
| isPrintNamespace | back to summary |
|---|---|
| public boolean isPrintNamespace() Indicates whether or not the name space should be written on the
| |
| setNamespaceUri | back to summary |
|---|---|
| public void setNamespaceUri(final String namespaceUri) Sets the namespace URI used for each record if
| |
| setPrettyPrint | back to summary |
|---|---|
| public void setPrettyPrint(final boolean prettyPrint) Turns on or off pretty printing.
| |
| setPrintNamespace | back to summary |
|---|---|
| public void setPrintNamespace(final boolean printNamespace) Turns on or off the printing of the namespace for each
| |
| Modifier and Type | Field and Description |
|---|---|
| private final XMLStreamWriter |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public StructuredFormatter. | add(final String
the key for the map key, final Map<String, ?> the map value)Implements org. Writes a map value |
| public StructuredFormatter. | add(final String
the key for the value key, final String the string value value)Implements org. Writes a string value. |
| public StructuredFormatter. | addAttribute(final String
the name of the attribute name, final int the value of the attribute value)Overrides default org. Writes an attribute. |
| public StructuredFormatter. | addAttribute(final String
the name of the attribute name, final String the value of the attribute value)Overrides default org. Writes an attribute. |
| public StructuredFormatter. | addMetaData(final Map<String, String>
the map of the meta data, cannot be metaData)nullOverrides default org. Adds the meta data to the structured format. |
| public StructuredFormatter. | begin()
Overrides default org. Initial method invoked at the start of the generation. |
| public StructuredFormatter. | end()
Implements org. Writes any trailing data that's needed. |
| public StructuredFormatter. | endObject()
Implements org. Writes an end to the object. |
| private void | |
| private void | |
| public StructuredFormatter. | startObject(final String
they key for the object, or key)null if this object was
started in an array and the wrapArrays() is
falseImplements org. Writes the start of an object. |
| public boolean | wrapArrays()
Overrides default org. Indicates whether or not elements in an array should be wrapped or not. |
| private void | |
| private void | |
| private void |
| xmlWriter | back to summary |
|---|---|
| private final XMLStreamWriter xmlWriter | |
| XmlGenerator | back to summary |
|---|---|
| private XmlGenerator(final XMLStreamWriter xmlWriter) | |
| add | back to summary |
|---|---|
| public StructuredFormatter. Implements org. Doc from org. Writes a map value | |
| add | back to summary |
|---|---|
| public StructuredFormatter. Implements org. Doc from org. Writes a string value. | |
| addAttribute | back to summary |
|---|---|
| public StructuredFormatter. Overrides default org. Doc from org. Writes an attribute.
By default this uses the
| |
| addAttribute | back to summary |
|---|---|
| public StructuredFormatter. Overrides default org. Doc from org. Writes an attribute.
By default this uses the | |
| addMetaData | back to summary |
|---|---|
| public StructuredFormatter. Overrides default org. Doc from org. Adds the meta data to the structured format.
By default this processes the map and uses | |
| begin | back to summary |
|---|---|
| public StructuredFormatter. Overrides default org. Doc from org. Initial method invoked at the start of the generation.
| |
| end | back to summary |
|---|---|
| public StructuredFormatter. Implements org. Doc from org. Writes any trailing data that's needed.
| |
| endObject | back to summary |
|---|---|
| public StructuredFormatter. Implements org. Doc from org. Writes an end to the object.
| |
| safeClose | back to summary |
|---|---|
| private void safeClose(final XMLStreamWriter closeable) | |
| safeFlush | back to summary |
|---|---|
| private void safeFlush(final XMLStreamWriter flushable) | |
| startObject | back to summary |
|---|---|
| public StructuredFormatter. Implements org. Doc from org. Writes the start of an object.
If the
| |
| wrapArrays | back to summary |
|---|---|
| public boolean wrapArrays() Overrides default org. Doc from org. Indicates whether or not elements in an array should be wrapped or not. The default is
| |
| writeEmpty | back to summary |
|---|---|
| private void writeEmpty(final String name) throws XMLStreamException | |
| writeEnd | back to summary |
|---|---|
| private void writeEnd() throws XMLStreamException | |
| writeStart | back to summary |
|---|---|
| private void writeStart(final String name) throws XMLStreamException | |