public final class SerializeSupport
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,java.lang.Object> |
prettyPrintParams
DOM configuration parameters used by LSSerializer in pretty print format output.
|
| Modifier | Constructor and Description |
|---|---|
private |
SerializeSupport()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static org.w3c.dom.ls.DOMImplementationLS |
getDOMImplementationLS(org.w3c.dom.Node node)
Gets the DOM, level 3, Load/Store implementation associated with the given node.
|
static org.w3c.dom.ls.LSSerializer |
getLSSerializer(org.w3c.dom.ls.DOMImplementationLS domImplLS,
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
Obtain a the DOM, level 3, Load/Save serializer
LSSerializer instance from the given
DOMImplementationLS instance. |
static java.lang.String |
nodeToString(org.w3c.dom.Node node)
Converts a Node into a String using the DOM, level 3, Load/Save serializer.
|
static java.lang.String |
nodeToString(org.w3c.dom.Node node,
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
Converts a Node into a String using the DOM, level 3, Load/Save serializer.
|
static java.lang.String |
prettyPrintXML(org.w3c.dom.Node node)
Converts a Node into a String, using the DOM, level 3, Load/Save serializer.
|
static void |
writeNode(org.w3c.dom.Node node,
java.io.OutputStream output)
Writes a Node out to a Writer using the DOM, level 3, Load/Save serializer.
|
static void |
writeNode(org.w3c.dom.Node node,
java.io.OutputStream output,
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
Writes a Node out to a Writer using the DOM, level 3, Load/Save serializer.
|
private static java.util.Map<java.lang.String,java.lang.Object> prettyPrintParams
@Nonnull
public static java.lang.String nodeToString(@Nonnull
org.w3c.dom.Node node)
node - the node to be written to a string@Nonnull
public static java.lang.String nodeToString(@Nonnull
org.w3c.dom.Node node,
@Nullable
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
node - the node to be written to a stringserializerParams - parameters to pass to the DOMConfiguration of the serializer instance, obtained
via LSSerializer.getDomConfig(). May be null.@Nonnull
public static java.lang.String prettyPrintXML(@Nonnull
org.w3c.dom.Node node)
node - xml node to printpublic static void writeNode(@Nonnull
org.w3c.dom.Node node,
@Nonnull
java.io.OutputStream output)
node - the node to write outoutput - the output stream to write the XML topublic static void writeNode(@Nonnull
org.w3c.dom.Node node,
@Nonnull
java.io.OutputStream output,
@Nullable
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
node - the node to write outoutput - the output stream to write the XML toserializerParams - parameters to pass to the DOMConfiguration of the serializer instance, obtained
via LSSerializer.getDomConfig(). May be null.@Nonnull
public static org.w3c.dom.ls.LSSerializer getLSSerializer(@Nonnull
org.w3c.dom.ls.DOMImplementationLS domImplLS,
@Nullable
java.util.Map<java.lang.String,java.lang.Object> serializerParams)
LSSerializer instance from the given
DOMImplementationLS instance.
The serializer instance will be configured with the parameters passed as the serializerParams
argument. It will also be configured with an LSSerializerFilter that shows all nodes to the filter, and
accepts all nodes shown.
domImplLS - the DOM Level 3 Load/Save implementation to useserializerParams - parameters to pass to the DOMConfiguration of the serializer instance, obtained
via LSSerializer.getDomConfig(). May be null.@Nonnull
public static org.w3c.dom.ls.DOMImplementationLS getDOMImplementationLS(@Nonnull
org.w3c.dom.Node node)
node - the node, never null