org.jcp.xml.dsig.internal.dom
Class DOMXMLObject

java.lang.Object
  extended by org.jcp.xml.dsig.internal.dom.DOMStructure
      extended by org.jcp.xml.dsig.internal.dom.DOMXMLObject
All Implemented Interfaces:
XMLObject, XMLStructure

public final class DOMXMLObject
extends DOMStructure
implements XMLObject

DOM-based implementation of XMLObject.

Author:
Sean Mullan

Field Summary
 
Fields inherited from interface javax.xml.crypto.dsig.XMLObject
TYPE
 
Constructor Summary
DOMXMLObject(org.w3c.dom.Element objElem, XMLCryptoContext context, java.security.Provider provider)
          Creates an XMLObject from an element.
DOMXMLObject(java.util.List content, java.lang.String id, java.lang.String mimeType, java.lang.String encoding)
          Creates an XMLObject from the specified parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.List getContent()
          Returns an unmodifiable list of XMLStructures contained in this XMLObject, which represent elements from any namespace.
 java.lang.String getEncoding()
          Returns the encoding URI of this XMLObject.
 java.lang.String getId()
          Returns the Id of this XMLObject.
 java.lang.String getMimeType()
          Returns the mime type of this XMLObject.
 int hashCode()
           
 void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, DOMCryptoContext context)
           
 
Methods inherited from class org.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
 
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
 

Constructor Detail

DOMXMLObject

public DOMXMLObject(java.util.List 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,
                    XMLCryptoContext context,
                    java.security.Provider provider)
             throws MarshalException
Creates an XMLObject from an element.

Parameters:
objElem - an Object element
Throws:
MarshalException - if there is an error when unmarshalling
Method Detail

getContent

public java.util.List getContent()
Description copied from interface: XMLObject
Returns an unmodifiable list of XMLStructures contained in this XMLObject, which represent elements from any namespace.

If there is a public subclass representing the type of XMLStructure, it is returned as an instance of that class (ex: a SignatureProperties element would be returned as an instance of SignatureProperties).

Specified by:
getContent in interface XMLObject
Returns:
an unmodifiable list of XMLStructures (may be empty but never null)

getId

public java.lang.String getId()
Description copied from interface: XMLObject
Returns the Id of this XMLObject.

Specified by:
getId in interface XMLObject
Returns:
the Id (or null if not specified)

getMimeType

public java.lang.String getMimeType()
Description copied from interface: XMLObject
Returns the mime type of this XMLObject. The mime type is an optional attribute which describes the data within this XMLObject (independent of its encoding).

Specified by:
getMimeType in interface XMLObject
Returns:
the mime type (or null if not specified)

getEncoding

public java.lang.String getEncoding()
Description copied from interface: XMLObject
Returns the encoding URI of this XMLObject. The encoding URI identifies the method by which the object is encoded.

Specified by:
getEncoding in interface XMLObject
Returns:
the encoding URI (or null if not specified)

marshal

public void marshal(org.w3c.dom.Node parent,
                    java.lang.String dsPrefix,
                    DOMCryptoContext context)
             throws MarshalException
Specified by:
marshal in class DOMStructure
Throws:
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


Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.