Class DOMDocument

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

public class DOMDocument extends 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:
  • 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()
      Description copied from interface: DSSDocument
      Opens a InputStream on the DSSDocument contents. The type of the InputStream depends on the type of the DSSDocument.
      Returns:
      an InputStream
    • 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 CommonDocument
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CommonDocument