Class Transform
java.lang.Object
org.apache.xml.security.utils.ElementProxy
org.apache.xml.security.utils.SignatureElementProxy
org.apache.xml.security.transforms.Transform
Implements the behaviour of the
ds:Transform
element.
This Transform
(Factory) class role as the Factory and Proxy of
implemanting class that have the functionality of a Transform
algorithm.
Implements the Factory and Proxy pattern for ds:Transform algorithms.- Author:
- Christian Geuer-Pollmann
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.xml.security.utils.ElementProxy
_baseURI, _constructionElement, _doc, _state, MODE_CREATE, MODE_DECRYPT, MODE_ENCRYPT, MODE_PROCESS, MODE_SIGN, MODE_UNKNOWN, MODE_VERIFY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the localname of the Elements of the sub-class.static final Transform
getInstance
(Document doc, String algorithmURI) Generates a Transform object that implements the specifiedTransform algorithm
URI.static final Transform
getInstance
(Document doc, String algorithmURI, Element contextChild) Generates a Transform object that implements the specifiedTransform algorithm
URI.static final Transform
getInstance
(Document doc, String algorithmURI, NodeList contextNodes) Generates a Transform object that implements the specifiedTransform algorithm
URI.final String
getURI()
Returns the URI representation of Transformation algorithmstatic void
init()
Initalizes for thisTransform
Transforms the input, and generatsXMLSignatureInput
as output.performTransform
(XMLSignatureInput input, OutputStream os) Transforms the input, and generatsXMLSignatureInput
as output.static void
Registers implementing class of the Transform algorithm with algorithmURIMethods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, guaranteeThatElementInCorrectSpace, length, setDefaultPrefix, setElement, setXPathNamespaceContext
-
Field Details
-
transformSpi
Field transformSpi
-
-
Constructor Details
-
Transform
public Transform(Document doc, String algorithmURI, NodeList contextNodes) throws InvalidTransformException ConstructsTransform
- Parameters:
doc
- theDocument
in whichTransform
will be placedalgorithmURI
- URI representation ofTransform algorithm
will be specified as parameter ofgetInstance(Document, String)
, when generate.contextNodes
- the child node list ofTransform
element- Throws:
InvalidTransformException
-
Transform
public Transform(Element element, String BaseURI) throws InvalidTransformException, TransformationException, XMLSecurityException This constructor can only be called from theTransforms
object, so it's protected.- Parameters:
element
-ds:Transform
elementBaseURI
- the URI of the resource where the XML instance was stored- Throws:
InvalidTransformException
TransformationException
XMLSecurityException
-
-
Method Details
-
getInstance
public static final Transform getInstance(Document doc, String algorithmURI) throws InvalidTransformException Generates a Transform object that implements the specifiedTransform algorithm
URI.- Parameters:
doc
- the proxyDocument
algorithmURI
-Transform algorithm
URI representation, such as specified in Transform algorithm- Returns:
objectTransform
- Throws:
InvalidTransformException
-
getInstance
public static final Transform getInstance(Document doc, String algorithmURI, Element contextChild) throws InvalidTransformException Generates a Transform object that implements the specifiedTransform algorithm
URI.- Parameters:
doc
- the proxyDocument
algorithmURI
-Transform algorithm
URI representation, such as specified in Transform algorithmcontextChild
- the child element ofTransform
element- Returns:
objectTransform
- Throws:
InvalidTransformException
-
getInstance
public static final Transform getInstance(Document doc, String algorithmURI, NodeList contextNodes) throws InvalidTransformException Generates a Transform object that implements the specifiedTransform algorithm
URI.- Parameters:
doc
- the proxyDocument
algorithmURI
-Transform algorithm
URI form, such as specified in Transform algorithmcontextNodes
- the child node list ofTransform
element- Returns:
objectTransform
- Throws:
InvalidTransformException
-
init
public static void init()Initalizes for thisTransform
-
register
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException Registers implementing class of the Transform algorithm with algorithmURI- Parameters:
algorithmURI
- algorithmURI URI representation ofTransform algorithm
will be specified as parameter ofgetInstance(Document, String)
, when generate.implementingClass
-implementingClass
the implementing class ofTransformSpi
- Throws:
AlgorithmAlreadyRegisteredException
- if specified algorithmURI is already registered
-
getURI
Returns the URI representation of Transformation algorithm- Returns:
- the URI representation of Transformation algorithm
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException Transforms the input, and generatsXMLSignatureInput
as output.- Parameters:
input
- inputXMLSignatureInput
which can supplied Octect Stream and NodeSet as Input of Transformation- Returns:
- the
XMLSignatureInput
class as the result of transformation - Throws:
CanonicalizationException
IOException
InvalidCanonicalizerException
TransformationException
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input, OutputStream os) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException Transforms the input, and generatsXMLSignatureInput
as output.- Parameters:
input
- inputXMLSignatureInput
which can supplied Octect Stream and NodeSet as Input of Transformationos
- where to output the result of the last transformation- Returns:
- the
XMLSignatureInput
class as the result of transformation - Throws:
CanonicalizationException
IOException
InvalidCanonicalizerException
TransformationException
-
getBaseLocalName
Description copied from class:ElementProxy
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalName
in classElementProxy
- Returns:
- the localname of the Elements of the sub-class.
-