Class DOMDocument

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

public class DOMDocument extends Object
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.
See Also:
  • Field Details

    • digestMap

      protected EnumMap<eu.europa.esig.dss.enumerations.DigestAlgorithm, byte[]> digestMap
    • mimeType

      protected eu.europa.esig.dss.enumerations.MimeType mimeType
    • name

      protected String name
  • 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)
    • hashCode

      public int hashCode()
    • save

      public void save(String arg0) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream arg0) throws IOException
      Throws:
      IOException
    • getMimeType

      public eu.europa.esig.dss.enumerations.MimeType getMimeType()
    • setMimeType

      public void setMimeType(eu.europa.esig.dss.enumerations.MimeType arg0)
    • getName

      public String getName()
    • setName

      public void setName(String arg0)
    • getDigest

      public eu.europa.esig.dss.model.Digest getDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0)
    • getDigestValue

      public byte[] getDigestValue(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0)
    • toString

      public String toString()
      Overrides:
      toString in class Object