Class DOMXMLObject

  • All Implemented Interfaces:
    javax.xml.crypto.dsig.XMLObject, javax.xml.crypto.XMLStructure

    public final class DOMXMLObject
    extends DOMStructure
    implements javax.xml.crypto.dsig.XMLObject
    DOM-based implementation of XMLObject.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<javax.xml.crypto.XMLStructure> content  
      private java.lang.String encoding  
      private java.lang.String id  
      private java.lang.String mimeType  
      private org.w3c.dom.Element objectElem  
      • Fields inherited from interface javax.xml.crypto.dsig.XMLObject

        TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      DOMXMLObject​(java.util.List<? extends javax.xml.crypto.XMLStructure> content, java.lang.String id, java.lang.String mimeType, java.lang.String encoding)
      Creates an XMLObject from the specified parameters.
      DOMXMLObject​(org.w3c.dom.Element objElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider)
      Creates an XMLObject from an element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      private boolean equalsContent​(java.util.List<javax.xml.crypto.XMLStructure> otherContent)  
      java.util.List<javax.xml.crypto.XMLStructure> getContent()  
      java.lang.String getEncoding()  
      java.lang.String getId()  
      java.lang.String getMimeType()  
      int hashCode()  
      void marshal​(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.xml.crypto.XMLStructure

        isFeatureSupported
    • Field Detail

      • id

        private final java.lang.String id
      • mimeType

        private final java.lang.String mimeType
      • encoding

        private final java.lang.String encoding
      • content

        private final java.util.List<javax.xml.crypto.XMLStructure> content
      • objectElem

        private org.w3c.dom.Element objectElem
    • Constructor Detail

      • DOMXMLObject

        public DOMXMLObject​(java.util.List<? extends javax.xml.crypto.XMLStructure> content,
                            java.lang.String id,
                            java.lang.String mimeType,
                            java.lang.String encoding)
        Creates an XMLObject from the specified parameters.
        Parameters:
        content - a list of XMLStructures. The list is defensively copied to protect against subsequent modification. May be null or empty.
        id - the Id (may be null)
        mimeType - the mime type (may be null)
        encoding - the encoding (may be null)
        Throws:
        java.lang.ClassCastException - if content contains any entries that are not of type XMLStructure
      • DOMXMLObject

        public DOMXMLObject​(org.w3c.dom.Element objElem,
                            javax.xml.crypto.XMLCryptoContext context,
                            java.security.Provider provider)
                     throws javax.xml.crypto.MarshalException
        Creates an XMLObject from an element.
        Parameters:
        objElem - an Object element
        Throws:
        javax.xml.crypto.MarshalException - if there is an error when unmarshalling
    • Method Detail

      • getContent

        public java.util.List<javax.xml.crypto.XMLStructure> getContent()
        Specified by:
        getContent in interface javax.xml.crypto.dsig.XMLObject
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface javax.xml.crypto.dsig.XMLObject
      • getMimeType

        public java.lang.String getMimeType()
        Specified by:
        getMimeType in interface javax.xml.crypto.dsig.XMLObject
      • getEncoding

        public java.lang.String getEncoding()
        Specified by:
        getEncoding in interface javax.xml.crypto.dsig.XMLObject
      • marshal

        public void marshal​(org.w3c.dom.Node parent,
                            java.lang.String dsPrefix,
                            javax.xml.crypto.dom.DOMCryptoContext context)
                     throws javax.xml.crypto.MarshalException
        Specified by:
        marshal in class DOMStructure
        Throws:
        javax.xml.crypto.MarshalException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equalsContent

        private boolean equalsContent​(java.util.List<javax.xml.crypto.XMLStructure> otherContent)