|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.util.export.xml.DOMSerializer
public class DOMSerializer
The DOMSerializer was based primarily off the DOMSerializer.java class from the "Java and XML" 3rd Edition book by Brett McLaughlin, and Justin Edelson. Some modifications were made to support formatting of elements and attributes.
Constructor Summary | |
---|---|
DOMSerializer()
|
Method Summary | |
---|---|
void |
serialize(org.w3c.dom.Document doc,
java.io.File file)
Serialize doc to out |
void |
serialize(org.w3c.dom.Document doc,
java.io.OutputStream out)
Serialize doc to out |
void |
serialize(org.w3c.dom.Document doc,
java.io.Writer writer)
Deprecated. this method does not set the encoding correctly. |
void |
setEncoding(java.lang.String encoding)
Set the encoding used by this serializer. |
void |
setIndent(int indent)
Set the number of spaces to use for indentation. |
void |
setLineSeparator(java.lang.String lineSeparator)
Set the line separator that will be used when serializing documents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMSerializer()
Method Detail |
---|
public void serialize(org.w3c.dom.Document doc, java.io.File file) throws java.io.IOException
doc
to out
doc
- the document to serialize.file
- the file to serialize to.
java.io.IOException
public void serialize(org.w3c.dom.Document doc, java.io.OutputStream out) throws java.io.IOException
doc
to out
doc
- the document to serialize.out
- the stream to serialize to.
java.io.IOException
@Deprecated public void serialize(org.w3c.dom.Document doc, java.io.Writer writer) throws java.io.IOException
doc
to writer
doc
- the document to serialize.writer
- the writer to serialize to.
java.io.IOException
public void setEncoding(java.lang.String encoding)
encoding
- the encoding to use, passing in null
results in the
default encoding (UTF-8) being set.
IllegalCharsetNameException
- if the given charset name is illegal.
UnsupportedCharsetException
- if the given charset is not supported by the
current JVM.public void setIndent(int indent)
The default is to use 4 spaces.
indent
- the number of spaces to use for indentation, values less than or
equal to zero result in no indentation being used.public void setLineSeparator(java.lang.String lineSeparator)
If this is not called then the serializer uses a default based on the
line.separator
system property.
lineSeparator
- the line separator to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |