public final class DOMSerializer extends Object
DOMImplementationLS
backed implementation.Constructor and Description |
---|
DOMSerializer(OutputStream pStream,
String pEncoding)
Creates a serializer using the given byte stream and encoding.
|
DOMSerializer(Writer pStream)
Creates a serializer using the given character stream and encoding.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getPrettyPrint() |
void |
serialize(Document pDocument)
Serializes the entire document.
|
void |
serialize(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(OutputStream pStream, String pEncoding)
pStream
- the byte stream.pEncoding
- the encoding.IllegalStateException
- if no DOMImplementation
with the right features can be instantiated.public DOMSerializer(Writer pStream)
pStream
- the characted stream.IllegalStateException
- if no DOMImplementation
with the right features can be instantiated.public void setPrettyPrint(boolean pPrettyPrint)
pPrettyPrint
- true
to enable pretty printingpublic boolean getPrettyPrint()
public void serialize(Document pDocument)
pDocument
- the document.public void serialize(Node pNode)
pNode
- the top node.Copyright © 2017. All rights reserved.