public class XmlFormatter extends StructuredFormatter
The details include;
StructuredFormatter.ExceptionOutputType, StructuredFormatter.Generator, StructuredFormatter.Key
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
DEFAULT_NAMESPACE |
Constructor | Description |
---|---|
XmlFormatter() |
Creates a new XML formatter.
|
XmlFormatter(java.lang.String keyOverrides) |
Creates a new XML formatter.
|
XmlFormatter(java.util.Map<StructuredFormatter.Key,java.lang.String> keyOverrides) |
Creates a new XML formatter.
|
Modifier and Type | Method | Description |
---|---|---|
protected StructuredFormatter.Generator |
createGenerator(java.io.Writer writer) |
Creates the generator used to create the structured data.
|
java.lang.String |
getNamespaceUri() |
Returns the namespace URI used for each record if
isPrintNamespace() is true . |
boolean |
isPrettyPrint() |
Indicates whether or not pretty printing is enabled.
|
boolean |
isPrintNamespace() |
Indicates whether or not the name space should be written on the
<record/> . |
void |
setNamespaceUri(java.lang.String namespaceUri) |
Sets the namespace URI used for each record if
isPrintNamespace() is true . |
void |
setPrettyPrint(boolean prettyPrint) |
Turns on or off pretty printing.
|
void |
setPrintNamespace(boolean printNamespace) |
Turns on or off the printing of the namespace for each
<record/> . |
format
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
after, before, format, getDateTimeFormatter, getExceptionOutputType, getKey, getKeyOverrides, getMetaData, getRecordDelimiter, getZoneId, isCallerCalculationRequired, isDetailedExceptionOutputType, isFormattedExceptionOutputType, isPrintDetails, setDateFormat, setExceptionOutputType, setMetaData, setPrintDetails, setRecordDelimiter, setZoneId
public static final java.lang.String DEFAULT_NAMESPACE
public XmlFormatter()
public XmlFormatter(java.lang.String keyOverrides)
If the keyOverrides
is empty the default namespace will be used.
keyOverrides
- a string representation of a map to override keysPropertyValues.stringToEnumMap(Class, String)
public XmlFormatter(java.util.Map<StructuredFormatter.Key,java.lang.String> keyOverrides)
If the keyOverrides
is empty the default namespace will be used.
keyOverrides
- a map of overrides for the default keyspublic boolean isPrettyPrint()
true
if pretty printing is enabled, otherwise false
public void setPrettyPrint(boolean prettyPrint)
prettyPrint
- true
to turn on pretty printing or false
to turn it offpublic boolean isPrintNamespace()
<record/>
.true
if the name space should be written for each recordpublic void setPrintNamespace(boolean printNamespace)
<record/>
. This is set to
false
by default.printNamespace
- true
if the name space should be written for each recordpublic java.lang.String getNamespaceUri()
isPrintNamespace()
is true
.null
if explicitly set to null
public void setNamespaceUri(java.lang.String namespaceUri)
isPrintNamespace()
is true
.namespaceUri
- the namespace to use or null
if no namespace URI should be used regardless of the
isPrintNamespace()
valueprotected StructuredFormatter.Generator createGenerator(java.io.Writer writer) throws java.lang.Exception
StructuredFormatter
createGenerator
in class StructuredFormatter
java.lang.Exception
- if an error occurs creating the generatorCopyright © 2018. All rights reserved.