Module jpms_dss_xml

Class DOMDocument

java.lang.Object
eu.europa.esig.dss.model.CommonDocument
eu.europa.esig.dss.xml.utils.DOMDocument
All Implemented Interfaces:
eu.europa.esig.dss.model.DSSDocument, Serializable

public class DOMDocument extends eu.europa.esig.dss.model.CommonDocument
This class allows handling of an org.w3c.dom.Node as a eu.europa.esig.dss.model.DSSDocument. The class handles the Node in memory, and reads its data only on request. This class uses a eu.europa.esig.dss.model.InMemoryDocument for internal processing of the cached org.w3c.dom.Node's content.
See Also:
  • Field Summary

    Fields inherited from class eu.europa.esig.dss.model.CommonDocument

    digestMap, mimeType, name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor to create a DOMDocument from an org.w3c.dom.Element.
    DOMDocument(Node node, String name)
    Constructor to create a DOMDocument with name provided.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected byte[]
    Gets cached binary array as the result of the Element serialization
    Gets the Node used to define the document
    int
     
     

    Methods inherited from class eu.europa.esig.dss.model.CommonDocument

    getDigest, getDigestValue, getMimeType, getName, save, setMimeType, setName, toString, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DOMDocument

      public DOMDocument(Node node)
      Default constructor to create a DOMDocument from an org.w3c.dom.Element. NOTE: Uses a MimeTypeEnum.XML MimeType by default.
      Parameters:
      node - Node to create a document from
    • DOMDocument

      public DOMDocument(Node node, String name)
      Constructor to create a DOMDocument with name provided. NOTE: Uses a MimeTypeEnum.XML MimeType by default.
      Parameters:
      node - Node to create a document from
      name - String the file name
  • Method Details

    • getNode

      public Node getNode()
      Gets the Node used to define the document
      Returns:
      Node
    • openStream

      public InputStream openStream()
    • getBytes

      protected byte[] getBytes()
      Gets cached binary array as the result of the Element serialization
      Returns:
      byte array
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class eu.europa.esig.dss.model.CommonDocument
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class eu.europa.esig.dss.model.CommonDocument