- 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 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
-
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI
-
-
Constructor Summary
Constructors Constructor Description Transform(Document doc, String algorithmURI)Generates a Transform object that implements the specifiedTransform algorithmURI.Transform(Document doc, String algorithmURI, Element contextChild)Generates a Transform object that implements the specifiedTransform algorithmURI.Transform(Document doc, String algorithmURI, NodeList contextNodes)ConstructsTransformTransform(Element element, String baseURI)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBaseLocalName()Returns the localname of the Elements of the sub-class.StringgetURI()Returns the URI representation of Transformation algorithmXMLSignatureInputperformTransform(XMLSignatureInput input, boolean secureValidation)Transforms the input, and generatesXMLSignatureInputas output.XMLSignatureInputperformTransform(XMLSignatureInput input, OutputStream os, boolean secureValidation)Transforms the input, and generatesXMLSignatureInputas output.static voidregister(String algorithmURI, Class<? extends TransformSpi> implementingClass)Registers implementing class of the Transform algorithm with algorithmURIstatic voidregister(String algorithmURI, String implementingClass)Registers implementing class of the Transform algorithm with algorithmURIstatic voidregisterDefaultAlgorithms()This method registers the default algorithms.-
Methods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
-
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
-
-
-
-
Constructor Detail
-
Transform
public Transform(Document doc, String algorithmURI) throws InvalidTransformException
Generates a Transform object that implements the specifiedTransform algorithmURI.- Parameters:
doc- the proxyDocumentalgorithmURI-Transform algorithmURI representation, such as specified in Transform algorithm- Throws:
InvalidTransformException
-
Transform
public Transform(Document doc, String algorithmURI, 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- Throws:
InvalidTransformException
-
Transform
public Transform(Document doc, String algorithmURI, NodeList contextNodes) throws InvalidTransformException
ConstructsTransform- Parameters:
doc- theDocumentin whichTransformwill be placedalgorithmURI- URI representation ofTransform algorithmcontextNodes- the child node list ofTransformelement- Throws:
InvalidTransformException
-
Transform
public Transform(Element element, String baseURI) throws InvalidTransformException, TransformationException, XMLSecurityException
- Parameters:
element-ds:TransformelementbaseURI- the URI of the resource where the XML instance was stored- Throws:
InvalidTransformExceptionTransformationExceptionXMLSecurityException
-
-
Method Detail
-
register
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException, InvalidTransformException
Registers implementing class of the Transform algorithm with algorithmURI- Parameters:
algorithmURI- algorithmURI URI representation ofTransform algorithmimplementingClass-implementingClassthe implementing class ofTransformSpi- Throws:
AlgorithmAlreadyRegisteredException- if specified algorithmURI is already registeredClassNotFoundException- if the implementing Class cannot be foundInvalidTransformException- if the implementing Class cannot be instantiatedSecurityException- if a security manager is installed and the caller does not have permission to register the transform
-
register
public static void register(String algorithmURI, Class<? extends TransformSpi> implementingClass) throws AlgorithmAlreadyRegisteredException, InvalidTransformException
Registers implementing class of the Transform algorithm with algorithmURI- Parameters:
algorithmURI- algorithmURI URI representation ofTransform algorithmimplementingClass-implementingClassthe implementing class ofTransformSpi- Throws:
AlgorithmAlreadyRegisteredException- if specified algorithmURI is already registeredInvalidTransformException- if the implementing Class cannot be instantiatedSecurityException- if a security manager is installed and the caller does not have permission to register the transform
-
registerDefaultAlgorithms
public static void registerDefaultAlgorithms()
This method registers the default algorithms.
-
getURI
public String getURI()
Returns the URI representation of Transformation algorithm- Returns:
- the URI representation of Transformation algorithm
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input, boolean secureValidation) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException
Transforms the input, and generatesXMLSignatureInputas output.- Parameters:
input- inputXMLSignatureInputwhich can supplied Octet Stream and NodeSet as Input of TransformationsecureValidation- Whether secure validation is enabled- Returns:
- the
XMLSignatureInputclass as the result of transformation - Throws:
CanonicalizationExceptionIOExceptionInvalidCanonicalizerExceptionTransformationException
-
performTransform
public XMLSignatureInput performTransform(XMLSignatureInput input, OutputStream os, boolean secureValidation) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException
Transforms the input, and generatesXMLSignatureInputas output.- Parameters:
input- inputXMLSignatureInputwhich can supplied Octet Stream and NodeSet as Input of Transformationos- where to output the result of the last transformationsecureValidation- Whether secure validation is enabled- Returns:
- the
XMLSignatureInputclass as the result of transformation - Throws:
CanonicalizationExceptionIOExceptionInvalidCanonicalizerExceptionTransformationException
-
getBaseLocalName
public String getBaseLocalName()
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- the localname of the Elements of the sub-class.
-
-