Class DOMSerializer

java.lang.Object
overit.geocall.xml.DOMSerializer

public class DOMSerializer extends Object
This class implements the object that can perform the DOM serialization starting from different sources that contains XML
  • Field Details

    • _e

      protected Element _e
    • _d

      protected Document _d
    • _indenting

      protected boolean _indenting
    • _indent

      protected int _indent
    • _encoding

      protected String _encoding
    • _omitXmlDeclaration

      protected boolean _omitXmlDeclaration
    • _useXerces

      protected static Boolean _useXerces
  • Constructor Details

    • DOMSerializer

      public DOMSerializer(Document d)
      Creates a DOMSerializer starting from the Document passed as parameter
      Parameters:
      d - The Document from which extract the child node, that is the document element of the Document
    • DOMSerializer

      public DOMSerializer(Element e)
      Creates a DOMSerializer starting from the Element passed as parameter
      Parameters:
      e - The Element used as DOM source
  • Method Details

    • serialize

      protected static void serialize(Document d, OutputStream os, String encoding, int indent)
    • serialize

      protected static void serialize(Document d, Writer w, String encoding, int indent)
    • serialize

      protected static void serialize(Document d, File f, String encoding, int indent)
    • setEncoding

      public void setEncoding(String encoding)
      Sets the encoding for the serialization
      Parameters:
      encoding - The string that defines the encoding
    • setEncoding

      public void setEncoding(Charset charset)
      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 - true to omit the declaration, false otherwise
    • useXerces

      protected boolean useXerces()
    • serialize

      public void serialize(OutputStream os)
      Serializes the OutputStream source
      Parameters:
      os - The source to serialize
    • serialize

      public void serialize(Writer w)
      Serializes the Writer source
      Parameters:
      w - The source to serialize
    • serialize

      public void serialize(File f)
      Serializes the File source
      Parameters:
      f - The source to serialize
    • serializeXerces

      protected void serializeXerces(Object output)
    • serializeTransform

      protected void serializeTransform(Result result)