Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.transforms

public final Class Transform

extends SignatureElementProxy
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.lang.reflect.InvocationTargetException, java.util.concurrent.ConcurrentHashMap, java.util.Map, javax.xml.parsers.ParserConfigurationException, com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException, .InvalidCanonicalizerException, com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException, .XMLSecurityException, com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput, com.sun.org.apache.xml.internal.security.transforms.implementations.TransformBase64Decode, .TransformC14N, .TransformC14N11, .TransformC14N11_WithComments, .TransformC14NExclusive, .TransformC14NExclusiveWithComments, .TransformC14NWithComments, .TransformEnvelopedSignature, .TransformXPath, .TransformXPath2Filter, .TransformXSLT, com.sun.org.apache.xml.internal.security.utils.Constants, .HelperNodeList, .JavaUtils, .SignatureElementProxy, .XMLUtils, org.w3c.dom.Document, .Element, .NodeList, org.xml.sax.SAXException

Implements the behaviour of the ds:Transform element. This Transform(Factory) class acts as the Factory and Proxy of the implementing class that supports the functionality of a Transform algorithm. Implements the Factory and Proxy pattern for ds:Transform algorithms.
See Also
Transforms, TransformSpi

Field Summary

Modifier and TypeField and Description
private static final Logger
private final TransformSpi
private static Map<String, TransformSpi>
transformSpiHash

All available Transform classes are registered here

Constructor Summary

AccessConstructor and Description
public
Transform(Document
the proxy Document
doc
,
String
Transform algorithm URI representation, such as specified in Transform algorithm
algorithmURI
)

Generates a Transform object that implements the specified Transform algorithm URI.

public
Transform(Document
the proxy Document
doc
,
String
Transform algorithm URI representation, such as specified in Transform algorithm
algorithmURI
,
Element
the child element of Transform element
contextChild
)

Generates a Transform object that implements the specified Transform algorithm URI.

public
Transform(Document
the Document in which Transform will be placed
doc
,
String
URI representation of Transform algorithm
algorithmURI
,
NodeList
the child node list of Transform element
contextNodes
)

Constructs Transform

public
Transform(Element
ds:Transform element
element
,
String
the URI of the resource where the XML instance was stored
baseURI
)

Method Summary

Modifier and TypeMethod and Description
public String
getBaseLocalName()

Implements abstract com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Returns the localname of the Elements of the sub-class.

public String

Returns:

the URI representation of Transformation algorithm
getURI
()

Returns the URI representation of Transformation algorithm

private TransformSpi
initializeTransform(String algorithmURI)

Initialize the transform object.

public XMLSignatureInput

Returns:

the XMLSignatureInput class as the result of transformation
performTransform
(XMLSignatureInput
input XMLSignatureInput which can supplied Octet Stream and NodeSet as Input of Transformation
input
,
boolean
Whether secure validation is enabled
secureValidation
)

Transforms the input, and generates XMLSignatureInput as output.

public XMLSignatureInput

Returns:

the XMLSignatureInput class as the result of transformation
performTransform
(XMLSignatureInput
input XMLSignatureInput which can supplied Octet Stream and NodeSet as Input of Transformation
input
,
OutputStream
where to output the result of the last transformation
os
,
boolean
Whether secure validation is enabled
secureValidation
)

Transforms the input, and generates XMLSignatureInput as output.

public static void
register(String
algorithmURI URI representation of Transform algorithm
algorithmURI
,
String
implementingClass the implementing class of TransformSpi
implementingClass
)

Registers implementing class of the Transform algorithm with algorithmURI

public static void
register(String
algorithmURI URI representation of Transform algorithm
algorithmURI
,
Class<? extends TransformSpi>
implementingClass the implementing class of TransformSpi
implementingClass
)

Registers implementing class of the Transform algorithm with algorithmURI

public static void
registerDefaultAlgorithms()

This method registers the default algorithms.

Inherited from com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy:
getBaseNamespace

Field Detail

LOGback to summary
private static final Logger LOG

Hides com.sun.org.apache.xml.internal.security.utils.ElementProxy.LOG.

transformSpiback to summary
private final TransformSpi transformSpi
transformSpiHashback to summary
private static Map<String, TransformSpi> transformSpiHash

All available Transform classes are registered here

Constructor Detail

Transformback to summary
public Transform(Document doc, String algorithmURI) throws InvalidTransformException

Generates a Transform object that implements the specified Transform algorithm URI.

Parameters
doc:Document

the proxy Document

algorithmURI:String

Transform algorithm URI representation, such as specified in Transform algorithm

Transformback to summary
public Transform(Document doc, String algorithmURI, Element contextChild) throws InvalidTransformException

Generates a Transform object that implements the specified Transform algorithm URI.

Parameters
doc:Document

the proxy Document

algorithmURI:String

Transform algorithm URI representation, such as specified in Transform algorithm

contextChild:Element

the child element of Transform element

Transformback to summary
public Transform(Document doc, String algorithmURI, NodeList contextNodes) throws InvalidTransformException

Constructs Transform

Parameters
doc:Document

the Document in which Transform will be placed

algorithmURI:String

URI representation of Transform algorithm

contextNodes:NodeList

the child node list of Transform element

Transformback to summary
public Transform(Element element, String baseURI) throws InvalidTransformException, TransformationException, XMLSecurityException
Parameters
element:Element

ds:Transform element

baseURI:String

the URI of the resource where the XML instance was stored

Method Detail

getBaseLocalNameback to summary
public String getBaseLocalName()

Implements abstract com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Doc from com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Returns the localname of the Elements of the sub-class.

Returns:String

the localname of the Elements of the sub-class.

getURIback to summary
public String getURI()

Returns the URI representation of Transformation algorithm

Returns:String

the URI representation of Transformation algorithm

initializeTransformback to summary
private TransformSpi initializeTransform(String algorithmURI) throws InvalidTransformException

Initialize the transform object.

performTransformback to summary
public XMLSignatureInput performTransform(XMLSignatureInput input, boolean secureValidation) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException

Transforms the input, and generates XMLSignatureInput as output.

Parameters
input:XMLSignatureInput

input XMLSignatureInput which can supplied Octet Stream and NodeSet as Input of Transformation

secureValidation:boolean

Whether secure validation is enabled

Returns:XMLSignatureInput

the XMLSignatureInput class as the result of transformation

performTransformback to summary
public XMLSignatureInput performTransform(XMLSignatureInput input, OutputStream os, boolean secureValidation) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException

Transforms the input, and generates XMLSignatureInput as output.

Parameters
input:XMLSignatureInput

input XMLSignatureInput which can supplied Octet Stream and NodeSet as Input of Transformation

os:OutputStream

where to output the result of the last transformation

secureValidation:boolean

Whether secure validation is enabled

Returns:XMLSignatureInput

the XMLSignatureInput class as the result of transformation

registerback to summary
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException, InvalidTransformException

Registers implementing class of the Transform algorithm with algorithmURI

Parameters
algorithmURI:String

algorithmURI URI representation of Transform algorithm

implementingClass:String

implementingClass the implementing class of TransformSpi

Annotations
@SuppressWarnings:unchecked
Exceptions
AlgorithmAlreadyRegisteredException:
if specified algorithmURI is already registered
ClassNotFoundException:
if the implementing Class cannot be found
InvalidTransformException:
if the implementing Class cannot be instantiated
SecurityException:
if a security manager is installed and the caller does not have permission to register the transform
registerback to summary
public static void register(String algorithmURI, Class<? extends TransformSpi> implementingClass) throws AlgorithmAlreadyRegisteredException, InvalidTransformException

Registers implementing class of the Transform algorithm with algorithmURI

Parameters
algorithmURI:String

algorithmURI URI representation of Transform algorithm

implementingClass:Class<? extends TransformSpi>

implementingClass the implementing class of TransformSpi

Exceptions
AlgorithmAlreadyRegisteredException:
if specified algorithmURI is already registered
InvalidTransformException:
if the implementing Class cannot be instantiated
SecurityException:
if a security manager is installed and the caller does not have permission to register the transform
registerDefaultAlgorithmsback to summary
public static void registerDefaultAlgorithms()

This method registers the default algorithms.