public class XMLObjectImpl extends XmldsigDOMStructure implements XMLObject
Object that supports the DOM XML
representation and processing mechanism.DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected List |
content_
The list
XMLStructures. |
protected String |
encoding_
The
Encoding attribute value. |
protected String |
id_
The
Id attribute value. |
protected String |
mimeType_
The
MimeType attribute value. |
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED| Constructor and Description |
|---|
XMLObjectImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
XMLObjectImpl with the
specified context and node to unmarshal from. |
XMLObjectImpl(List content,
String id,
String mimeType,
String encoding)
Creates a new instance of this
XMLObjectImpl with the
specified list of XMLStructures, id-attribute value,
MimeType-attribute value and Encoding-attribute
value. |
| Modifier and Type | Method and Description |
|---|---|
protected List |
getChildStructures()
Returns the list of child structures of this
DOMStructure. |
List |
getContent()
Returns an
unmodifiable list of XMLStructures contained in this
XMLObject, which represent elements from any namespace. |
String |
getEncoding()
Returns the encoding URI of this
XMLObject. |
String |
getId()
Returns the Id of this
XMLObject. |
String |
getLocalName()
Returns the local name of the represented XML element.
|
String |
getMimeType()
Returns the mime type of this
XMLObject. |
protected void |
marshalAttributes(DOMCryptoContext context,
Element parent)
Marshals the
MimeType and Encoding attributes. |
protected Attr |
marshalIDAttribute(DOMCryptoContext context,
Element parent)
Marshals the XML representation of an optional
Id-attribute
represented by this DOMStructure. |
void |
putChildStructure(DOMStructure childStructure)
Put an unmarshalled child structure.
|
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshals the
MimeType, URI and Id
attributes. |
protected void |
unmarshalStructures(NodeList nodes,
DOMCryptoContext context)
Unmarshals
DOMStructures from the given nodes. |
getNamespace, initaddBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshal, marshalElement, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalElement, unmarshalIDAttribute, wrapNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFeatureSupportedprotected List content_
XMLStructures. (may not be
null)protected String id_
Id attribute value.protected String mimeType_
MimeType attribute value.protected String encoding_
Encoding attribute value.public XMLObjectImpl(DOMCryptoContext context, Node node) throws MarshalException
XMLObjectImpl with the
specified context and node to unmarshal from.context - the contextnode - the node to unmarshal fromMarshalException - if an exception occurs during unmarshalingpublic XMLObjectImpl(List content, String id, String mimeType, String encoding)
XMLObjectImpl with the
specified list of XMLStructures, id-attribute value,
MimeType-attribute value and Encoding-attribute
value.content - a list of XMLStructures (may be empty or null)id - the Id-attribute value (may be null)mimeType - the MimeType-attribute value (may be null)encoding - the Encoding-attribute value (may be null)public String getLocalName()
DOMStructuregetLocalName in class DOMStructureDOMStructure.getLocalName()public List getContent()
javax.xml.crypto.dsig.XMLObjectunmodifiable 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).
getContent in interface XMLObjectXMLStructure s (may be empty
but never null)XMLObject.getContent()public String getId()
javax.xml.crypto.dsig.XMLObjectXMLObject.getId in interface XMLObjectnull if not specified)XMLObject.getId()public String getMimeType()
javax.xml.crypto.dsig.XMLObjectXMLObject. The mime type is an
optional attribute which describes the data within this
XMLObject (independent of its encoding).getMimeType in interface XMLObjectnull if not specified)XMLObject.getMimeType()public String getEncoding()
javax.xml.crypto.dsig.XMLObjectXMLObject. The encoding URI
identifies the method by which the object is encoded.getEncoding in interface XMLObjectnull if not specified)XMLObject.getEncoding()protected void marshalAttributes(DOMCryptoContext context, Element parent) throws MarshalException
MimeType and Encoding attributes.marshalAttributes in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.MarshalException - if an exception occurs during marshalingprotected Attr marshalIDAttribute(DOMCryptoContext context, Element parent)
DOMStructureId-attribute
represented by this DOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method in order to marshal an
Id-attribute.
marshalIDAttribute in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.Id-attribute if any, otherwise
nullDOMStructure.marshalIDAttribute(DOMCryptoContext,
Element)protected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
MimeType, URI and Id
attributes.unmarshalAttributes in class DOMStructureattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingprotected void unmarshalStructures(NodeList nodes, DOMCryptoContext context) throws MarshalException
DOMStructureDOMStructures from the given nodes.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
This method calls DOMStructure.getInstance(Node, DOMCryptoContext) for every
Element in the list of nodes. If
DOMStructure.getInstance(Node, DOMCryptoContext) returns a
DOMStructure DOMStructure.putChildStructure(DOMStructure) is
called with the returned DOMStructure as parameter.
unmarshalStructures in class DOMStructurenodes - the nodes to unmarshal fromcontext - the marshal contextMarshalException - if an exception occurs during marshalingDOMStructure.unmarshalStructures(org.w3c.dom.NodeList,
DOMCryptoContext)public void putChildStructure(DOMStructure childStructure) throws MarshalException
DOMStructure
This method is called by
DOMStructure.unmarshalStructures(NodeList, DOMCryptoContext) for every
unmarshalled child structure.
A subclass has to overwrite this method to store the given child structure in its the corresponding field.
putChildStructure in class DOMStructurechildStructure - the unmarshalled child structureMarshalExceptionprotected List getChildStructures()
DOMStructureDOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method to return a list of
DOMStrucutres represented by this subclass.
getChildStructures in class DOMStructureDOMStructures (may be empty, but never
null)© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC