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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSerializedoctooutvoidserialize(Document doc, OutputStream out) SerializedoctooutvoidsetEncoding(String encoding) Set the encoding used by this serializer.voidsetIndent(int indent) Set the number of spaces to use for indentation.voidsetLineSeparator(String lineSeparator) Set the line separator that will be used when serializing documents.
-
Constructor Details
-
DOMSerializer
public DOMSerializer()
-
-
Method Details
-
serialize
Serializedoctoout- Parameters:
doc- the document to serialize.file- the file to serialize to.- Throws:
IOException- for various error conditions
-
serialize
Serializedoctoout- 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 innullresults 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.separatorsystem property.- Parameters:
lineSeparator- the line separator to set.
-