Package com.jme3.export.xml
Class DOMSerializer
java.lang.Object
com.jme3.export.xml.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Serializedoc
toout
void
serialize
(Document doc, OutputStream out) Serializedoc
toout
void
setEncoding
(String encoding) Set the encoding used by this serializer.void
setIndent
(int indent) Set the number of spaces to use for indentation.void
setLineSeparator
(String lineSeparator) Set the line separator that will be used when serializing documents.
-
Constructor Details
-
DOMSerializer
public DOMSerializer()
-
-
Method Details
-
serialize
Serializedoc
toout
- Parameters:
doc
- the document to serialize.file
- the file to serialize to.- Throws:
IOException
- for various error conditions
-
serialize
Serializedoc
toout
- Parameters:
doc
- the document to serialize.out
- the stream to serialize to.- Throws:
IOException
- for various error conditions
-
setEncoding
Set the encoding used by this serializer.- Parameters:
encoding
- the encoding to use, passing innull
results in the default encoding (UTF-8) being set.
-
setIndent
public void setIndent(int indent) Set the number of spaces to use for indentation.The default is to use 4 spaces.
- Parameters:
indent
- the number of spaces to use for indentation, values less than or equal to zero result in no indentation being used.
-
setLineSeparator
Set the line separator that will be used when serializing documents.If this is not called then the serializer uses a default based on the
line.separator
system property.- Parameters:
lineSeparator
- the line separator to set.
-