public class XmlFormatter extends StructuredFormatter
The details include;
StructuredFormatter.ExceptionOutputType, StructuredFormatter.Generator, StructuredFormatter.Key| Modifier and Type | Field | Description |
|---|---|---|
static String |
DEFAULT_NAMESPACE |
| Constructor | Description |
|---|---|
XmlFormatter() |
Creates a new XML formatter.
|
XmlFormatter(String keyOverrides) |
Creates a new XML formatter.
|
XmlFormatter(Map<StructuredFormatter.Key,String> keyOverrides) |
Creates a new XML formatter.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected StructuredFormatter.Generator |
createGenerator(Writer writer) |
Creates the generator used to create the structured data.
|
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(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/>. |
formatformatMessage, getHead, getTailclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafter, before, format, getDateTimeFormatter, getExceptionOutputType, getKey, getKeyOverrides, getMetaData, getRecordDelimiter, getZoneId, isCallerCalculationRequired, isDetailedExceptionOutputType, isFormattedExceptionOutputType, isPrintDetails, setDateFormat, setExceptionOutputType, setMetaData, setPrintDetails, setRecordDelimiter, setZoneIdpublic static final String DEFAULT_NAMESPACE
public XmlFormatter()
public XmlFormatter(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(Map<StructuredFormatter.Key,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 falsepublic 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 String getNamespaceUri()
isPrintNamespace() is true.null if explicitly set to nullpublic void setNamespaceUri(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(Writer writer) throws Exception
StructuredFormattercreateGenerator in class StructuredFormatterException - if an error occurs creating the generatorCopyright © 2019 JBoss by Red Hat. All rights reserved.