public class TransformImpl extends DOMStructure implements Transform
Transform that supports the DOM XML
representation and processing mechanism.DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected URI |
algorithm_
The algorithm URI.
|
protected DOMStructure |
params_
The algorithm parameters if given in XML form.
|
protected TransformService |
service_
The transform service.
|
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED| Modifier | Constructor and Description |
|---|---|
protected |
TransformImpl()
Creates a new instance of this
TransformImpl. |
|
TransformImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
TransformImpl with the
specified context and the node to unmarshal from. |
protected |
TransformImpl(Node node)
Creates a new instance of this
TransformImpl with the
specified node. |
|
TransformImpl(String algorithm,
DOMStructure params)
Creates a new instance of this
TransformImpl with specified
algorithm URI and parameters. |
|
TransformImpl(String algorithm,
TransformParameterSpec params)
Creates a new instance of this
TransformImpl with the
specified algorithm URI and parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearMarshalling()
This Method is required to link the resetting of the marshaled
DOMStructures with the
AlgorithmParameterImpl instances that
would otherwise be separated by the TransformService
service_. |
String |
getAlgorithm()
Returns the algorithm URI of this
AlgorithmMethod. |
String |
getLocalName()
Returns the local name of the represented XML element.
|
String |
getNamespace()
Returns the namespace URI of the represented XML element.
|
AlgorithmParameterSpec |
getParameterSpec()
Returns the algorithm-specific input parameters associated with this
Transform. |
TransformService |
getTransformService()
Returns the TransformService.
|
Node |
marshal(DOMCryptoContext context,
Node parent,
Node nextSibling)
Marshal the DOM node representation of this
DOMStructure and
all its child DOMStructures. |
protected void |
marshalAttributes(DOMCryptoContext context,
Element parent)
Marshals the
Algorithm attribute. |
protected void |
setTransformService()
Fetches the provider and sets the
transform service. |
String |
toString() |
Data |
transform(Data data,
XMLCryptoContext context)
Transforms the specified data using the underlying transform algorithm.
|
Data |
transform(Data data,
XMLCryptoContext context,
OutputStream os)
Transforms the specified data using the underlying transform algorithm.
|
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshals the
Algorithm attribute. |
protected void |
unmarshalStructures(NodeList nodes,
DOMCryptoContext context)
Unmarshals
DOMStructures from the given nodes. |
addBytesToElement, addBytesToElement, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructures, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshalElement, marshalIDAttribute, newIDforLookUp, putChildStructure, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, unmarshal, unmarshalElement, unmarshalIDAttribute, wrapNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFeatureSupportedprotected URI algorithm_
null)protected DOMStructure params_
protected TransformService service_
null)protected TransformImpl()
TransformImpl.protected TransformImpl(Node node)
TransformImpl with the
specified node.node - the nodepublic TransformImpl(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
TransformImpl with the
specified algorithm URI and parameters.algorithm - the URI identifying the transform algorithmparams - algorithm-specific transform parameters (may be null)NoSuchAlgorithmException - if an implementation of the specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters are inappropriate for the requested
algorithmNullPointerException - if algorithm is nullpublic TransformImpl(String algorithm, DOMStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
TransformImpl with specified
algorithm URI and parameters. The parameters are specified as a
mechanism-specific XMLStructure (
DOMStructure). This method is useful when the
parameters are in XML form or there is no standard class for specifying the
parameters.algorithm - the URI identifying the transform algorithmparams - a mechanism-specific XML structure from which to unmarshal the
parameters from (may be null if not required or
optional)ClassCastException - if the type of params is inappropriate for this
XMLSignatureFactoryNoSuchAlgorithmException - if an implementation of the specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters are inappropriate for the requested
algorithmNullPointerException - if if algorithm is nullpublic TransformImpl(DOMCryptoContext context, Node node) throws MarshalException
TransformImpl with the
specified context and the node to unmarshal from.context - the marshal contextnode - the node to unmarshal fromMarshalException - if an exception occurs during unmarshalingpublic String getLocalName()
DOMStructuregetLocalName in class DOMStructureDOMStructure.getLocalName()public String getNamespace()
DOMStructuregetNamespace in class DOMStructureDOMStructure.getNamespace()public AlgorithmParameterSpec getParameterSpec()
javax.xml.crypto.dsig.TransformTransform.
The returned parameters can be typecast to a
TransformParameterSpec object.
getParameterSpec in interface AlgorithmMethodgetParameterSpec in interface TransformAlgorithmMethod.
Returns null if this AlgorithmMethod does
not require parameters and they are not specified.AlgorithmMethod.getParameterSpec()public Data transform(Data data, XMLCryptoContext context) throws TransformException
javax.xml.crypto.dsig.Transformtransform in interface Transformdata - the data to be transformedcontext - the XMLCryptoContext containing additional context (may
be null if not applicable)TransformException - if an error occurs while executing the transformTransform.transform(javax.xml.crypto.Data,
javax.xml.crypto.XMLCryptoContext)public Data transform(Data data, XMLCryptoContext context, OutputStream os) throws TransformException
javax.xml.crypto.dsig.TransformOctetStreamData, then this
method returns null and the bytes are written to the specified
OutputStream. Otherwise, the OutputStream is
ignored and the method behaves as if
Transform.transform(Data, XMLCryptoContext)were invoked.transform in interface Transformdata - the data to be transformedcontext - the XMLCryptoContext containing additional context (may
be null if not applicable)os - the OutputStream that should be used to write the
transformed data tonull if the data was written
to the OutputStream parameter)TransformException - if an error occurs while executing the transformTransform.transform(javax.xml.crypto.Data,
javax.xml.crypto.XMLCryptoContext, java.io.OutputStream)public String getAlgorithm()
javax.xml.crypto.AlgorithmMethodAlgorithmMethod.getAlgorithm in interface AlgorithmMethodAlgorithmMethodAlgorithmMethod.getAlgorithm()public TransformService getTransformService()
protected void marshalAttributes(DOMCryptoContext context, Element parent) throws MarshalException
Algorithm attribute.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 void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
Algorithm attribute.unmarshalAttributes in class DOMStructureattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingpublic Node marshal(DOMCryptoContext context, Node parent, Node nextSibling) throws MarshalException
DOMStructureDOMStructure and
all its child DOMStructures.
marshal in class DOMStructurecontext - the DOMMarshalContext holding context information about
the marshaling of this DOMStructureparent - where to place the marshalled nodenextSibling - before wich to place the marshalled nodeDOMStrucuture and
all its child DOMStructuruesMarshalException - if the marshaling fails for any reasonDOMStructure.marshal(DOMCryptoContext, Node, Node)protected 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),
TransformServiceImpl.init(XMLStructure,
XMLCryptoContext)protected void clearMarshalling()
DOMStructures with the
AlgorithmParameterImpl instances that
would otherwise be separated by the TransformService
service_.clearMarshalling in class DOMStructureDOMStructure.clearMarshalling()public String toString()
toString in class DOMStructureprotected void setTransformService()
throws NoSuchAlgorithmException
transform service.NoSuchAlgorithmException© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC