Class Transform
- java.lang.Object
-
- org.apache.xml.security.utils.ElementProxy
-
- org.apache.xml.security.utils.SignatureElementProxy
-
- org.apache.xml.security.transforms.Transform
-
public final class Transform extends SignatureElementProxy
Implements the behaviour of theds:Transformelement. ThisTransform(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:
Transforms,TransformSpi
-
-
Field Summary
Fields Modifier and Type Field Description protected TransformSpitransformSpiField transformSpi-
Fields 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 Constructor Description Transform(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes)ConstructsTransformTransform(org.w3c.dom.Element element, java.lang.String BaseURI)This constructor can only be called from theTransformsobject, so it's protected.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseLocalName()Returns the localname of the Elements of the sub-class.static TransformgetInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI)Generates a Transform object that implements the specifiedTransform algorithmURI.static TransformgetInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.Element contextChild)Generates a Transform object that implements the specifiedTransform algorithmURI.static TransformgetInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes)Generates a Transform object that implements the specifiedTransform algorithmURI.java.lang.StringgetURI()Returns the URI representation of Transformation algorithmstatic voidinit()Initalizes for thisTransformXMLSignatureInputperformTransform(XMLSignatureInput input)Transforms the input, and generatsXMLSignatureInputas output.XMLSignatureInputperformTransform(XMLSignatureInput input, java.io.OutputStream os)Transforms the input, and generatsXMLSignatureInputas output.static voidregister(java.lang.String algorithmURI, java.lang.String implementingClass)Registers implementing class of the Transform algorithm with algorithmURI-
Methods 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 Detail
-
transformSpi
protected TransformSpi transformSpi
Field transformSpi
-
-
Constructor Detail
-
Transform
public Transform(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes) throws InvalidTransformExceptionConstructsTransform- Parameters:
doc- theDocumentin whichTransformwill be placedalgorithmURI- URI representation ofTransform algorithmwill be specified as parameter ofgetInstance(Document, String), when generate.contextNodes- the child node list ofTransformelement- Throws:
InvalidTransformException
-
Transform
public Transform(org.w3c.dom.Element element, java.lang.String BaseURI) throws InvalidTransformException, TransformationException, XMLSecurityExceptionThis constructor can only be called from theTransformsobject, so it's protected.- Parameters:
element-ds:TransformelementBaseURI- the URI of the resource where the XML instance was stored- Throws:
InvalidTransformExceptionTransformationExceptionXMLSecurityException
-
-
Method Detail
-
getInstance
public static final Transform getInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI) throws InvalidTransformException
Generates a Transform object that implements the specifiedTransform algorithmURI.- Parameters:
algorithmURI-Transform algorithmURI representation, such as specified in Transform algorithmdoc- the proxyDocument- Returns:
objectTransform- Throws:
InvalidTransformException
-
getInstance
public static final Transform getInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.Element contextChild) throws InvalidTransformException
Generates a Transform object that implements the specifiedTransform algorithmURI.- Parameters:
algorithmURI-Transform algorithmURI representation, such as specified in Transform algorithmcontextChild- the child element ofTransformelementdoc- the proxyDocument- Returns:
objectTransform- Throws:
InvalidTransformException
-
getInstance
public static final Transform getInstance(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes) throws InvalidTransformException
Generates a Transform object that implements the specifiedTransform algorithmURI.- Parameters:
algorithmURI-Transform algorithmURI form, such as specified in Transform algorithmcontextNodes- the child node list ofTransformelementdoc- the proxyDocument- Returns:
objectTransform- Throws:
InvalidTransformException
-
init
public static void init()
Initalizes for thisTransform
-
register
public static void register(java.lang.String algorithmURI, java.lang.String implementingClass) throws AlgorithmAlreadyRegisteredExceptionRegisters implementing class of the Transform algorithm with algorithmURI- Parameters:
algorithmURI- algorithmURI URI representation ofTransform algorithmwill be specified as parameter ofgetInstance(Document, String), when generate.implementingClass-implementingClassthe implementing class ofTransformSpi- Throws:
AlgorithmAlreadyRegisteredException- if specified algorithmURI is already registered
-
getURI
public final java.lang.String getURI()
Returns the URI representation of Transformation algorithm- Returns:
- the URI representation of Transformation algorithm
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input) throws java.io.IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException
Transforms the input, and generatsXMLSignatureInputas output.- Parameters:
input- inputXMLSignatureInputwhich can supplied Octect Stream and NodeSet as Input of Transformation- Returns:
- the
XMLSignatureInputclass as the result of transformation - Throws:
CanonicalizationExceptionjava.io.IOExceptionInvalidCanonicalizerExceptionTransformationException
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input, java.io.OutputStream os) throws java.io.IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException
Transforms the input, and generatsXMLSignatureInputas output.- Parameters:
input- inputXMLSignatureInputwhich can supplied Octect Stream and NodeSet as Input of Transformationos- where to output the result of the last transformation- Returns:
- the
XMLSignatureInputclass as the result of transformation - Throws:
CanonicalizationExceptionjava.io.IOExceptionInvalidCanonicalizerExceptionTransformationException
-
getBaseLocalName
public java.lang.String getBaseLocalName()
Description copied from class:ElementProxyReturns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- the localname of the Elements of the sub-class.
-
-