public final class DOMSerializer
extends java.lang.Object
DOMImplementationLS backed implementation.| Constructor and Description |
|---|
DOMSerializer(java.io.OutputStream pStream,
java.lang.String pEncoding)
Creates a serializer using the given byte stream and encoding.
|
DOMSerializer(java.io.Writer pStream)
Creates a serializer using the given character stream and encoding.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getPrettyPrint() |
void |
serialize(org.w3c.dom.Document pDocument)
Serializes the entire document.
|
void |
serialize(org.w3c.dom.Node pNode)
Serializes the given node, along with any subnodes.
|
void |
setPrettyPrint(boolean pPrettyPrint)
Specifies wether the serializer should use indentation and optimize for
readability.
|
public DOMSerializer(java.io.OutputStream pStream,
java.lang.String pEncoding)
pStream - the byte stream.pEncoding - the encoding.java.lang.IllegalStateException - if no DOMImplementation with the right features can be instantiated.public DOMSerializer(java.io.Writer pStream)
pStream - the characted stream.java.lang.IllegalStateException - if no DOMImplementation with the right features can be instantiated.public void setPrettyPrint(boolean pPrettyPrint)
Note: This is a hint, and may be ignored by DOM implementations.
pPrettyPrint - true to enable pretty printingpublic boolean getPrettyPrint()
public void serialize(org.w3c.dom.Document pDocument)
pDocument - the document.public void serialize(org.w3c.dom.Node pNode)
pNode - the top node.Copyright © 2020. All Rights Reserved.