Package overit.geocall.xml
Class DOMSerializer
java.lang.Object
overit.geocall.xml.DOMSerializer
This class implements the object that can perform the DOM serialization starting from different sources
that contains XML
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSerializes theFilesourcevoidSerializes theOutputStreamsourcevoidSerializes theWritersourceprotected static voidprotected static voidserialize(Document d, OutputStream os, String encoding, int indent) protected static voidprotected voidserializeTransform(Result result) protected voidserializeXerces(Object output) voidsetEncoding(String encoding) Sets the encoding for the serializationvoidsetEncoding(Charset charset) Sets the encoding for the serializationvoidsetIndent(int indent) Sets the indentation value for the serializationvoidsetOmitXmlDeclaration(boolean omit) Defines if the XML declaration must be omitted or notprotected boolean
-
Field Details
-
_e
-
_d
-
_indenting
protected boolean _indenting -
_indent
protected int _indent -
_encoding
-
_omitXmlDeclaration
protected boolean _omitXmlDeclaration -
_useXerces
-
-
Constructor Details
-
DOMSerializer
Creates a DOMSerializer starting from theDocumentpassed as parameter- Parameters:
d- The Document from which extract the child node, that is the document element of the Document
-
DOMSerializer
Creates a DOMSerializer starting from theElementpassed as parameter- Parameters:
e- The Element used as DOM source
-
-
Method Details
-
serialize
-
serialize
-
serialize
-
setEncoding
Sets the encoding for the serialization- Parameters:
encoding- The string that defines the encoding
-
setEncoding
Sets the encoding for the serialization- Parameters:
charset- The charset that defines the encoding
-
setIndent
public void setIndent(int indent) Sets the indentation value for the serialization- Parameters:
indent- The indentation, expressed in number of characters. To avoid using indentation, set the value -1, that is the default one
-
setOmitXmlDeclaration
public void setOmitXmlDeclaration(boolean omit) Defines if the XML declaration must be omitted or not- Parameters:
omit-trueto omit the declaration,falseotherwise
-
useXerces
protected boolean useXerces() -
serialize
Serializes theOutputStreamsource- Parameters:
os- The source to serialize
-
serialize
Serializes theWritersource- Parameters:
w- The source to serialize
-
serialize
Serializes theFilesource- Parameters:
f- The source to serialize
-
serializeXerces
-
serializeTransform
-