@Immutable public final class XMLWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static NamespaceContext |
DEFAULT_NAMESPACE_CTX
By default no XML namespace map is present
|
static EXMLVersion |
DEFAULT_XML_VERSION
The default XML version to be used
|
| Modifier and Type | Method and Description |
|---|---|
static String |
getNodeAsString(Node aNode,
IXMLWriterSettings aSettings) |
static String |
getXMLString(Node aNode)
Convert the passed micro node to an XML string using
XMLWriterSettings.DEFAULT_XML_SETTINGS. |
static ESuccess |
writeToStream(Node aNode,
OutputStream aOS)
Write a node to an
OutputStream using the default settings. |
static ESuccess |
writeToStream(Node aNode,
OutputStream aOS,
IXMLWriterSettings aSettings)
Write a node to an
OutputStream using custom settings. |
static ESuccess |
writeToWriter(Node aNode,
Writer aWriter)
Write a node to a
Writer using the default settings. |
static ESuccess |
writeToWriter(Node aNode,
Writer aWriter,
IXMLWriterSettings aSettings)
Write a node to a
Writer using the default settings. |
public static final EXMLVersion DEFAULT_XML_VERSION
public static final NamespaceContext DEFAULT_NAMESPACE_CTX
@Nonnull public static ESuccess writeToStream(@Nonnull Node aNode, @Nonnull@WillClose OutputStream aOS)
OutputStream using the default settings.aNode - The node to be serialized. May be any kind of node (incl.
documents). May not be null.aOS - The OutputStream to write to. May not be null.
The OutputStream is closed anyway directly after the
operation finishes (on success and on error).ESuccess@Nonnull public static ESuccess writeToStream(@Nonnull Node aNode, @Nonnull@WillClose OutputStream aOS, @Nonnull IXMLWriterSettings aSettings)
OutputStream using custom settings.aNode - The node to be serialized. May be any kind of node (incl.
documents). May not be null.aOS - The OutputStream to write to. May not be null.
The OutputStream is closed anyway directly after the
operation finishes (on success and on error).aSettings - The serialization settings to be used. May not be null.ESuccess@Nonnull public static ESuccess writeToWriter(@Nonnull Node aNode, @Nonnull@WillClose Writer aWriter)
Writer using the default settings.@Nonnull public static ESuccess writeToWriter(@Nonnull Node aNode, @Nonnull@WillClose Writer aWriter, @Nonnull IXMLWriterSettings aSettings)
Writer using the default settings.aNode - The node to be serialized. May be any kind of node (incl.
documents). May not be null.aWriter - The Writer to write to. May not be null. The
Writer is closed anyway directly after the operation
finishes (on success and on error).aSettings - The serialization settings to be used. May not be null.ESuccess@Nullable public static String getNodeAsString(@Nonnull Node aNode, @Nonnull IXMLWriterSettings aSettings)
@Nullable public static String getXMLString(@Nonnull Node aNode)
XMLWriterSettings.DEFAULT_XML_SETTINGS. This is a specialized
version of getNodeAsString(Node, IXMLWriterSettings).aNode - The node to be converted to a string. May not be null .Copyright © 2006–2014 phloc systems. All rights reserved.