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 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 Modifier and Type Field Description private static org.slf4j.LoggerLOGprivate booleansecureValidationprivate TransformSpitransformSpiprivate static java.util.Map<java.lang.String,java.lang.Class<? extends TransformSpi>>transformSpiHashAll available Transform classes are registered here-
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI
-
-
Constructor Summary
Constructors Constructor Description Transform(org.w3c.dom.Document doc, java.lang.String algorithmURI)Generates a Transform object that implements the specifiedTransform algorithmURI.Transform(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.Element contextChild)Generates a Transform object that implements the specifiedTransform algorithmURI.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)
-
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.java.lang.StringgetURI()Returns the URI representation of Transformation algorithmprivate TransformSpiinitializeTransform(java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes)Initialize the transform object.booleanisSecureValidation()XMLSignatureInputperformTransform(XMLSignatureInput input)Transforms the input, and generatesXMLSignatureInputas output.XMLSignatureInputperformTransform(XMLSignatureInput input, java.io.OutputStream os)Transforms the input, and generatesXMLSignatureInputas output.static voidregister(java.lang.String algorithmURI, java.lang.Class<? extends TransformSpi> implementingClass)Registers implementing class of the Transform algorithm with algorithmURIstatic voidregister(java.lang.String algorithmURI, java.lang.String implementingClass)Registers implementing class of the Transform algorithm with algorithmURIstatic voidregisterDefaultAlgorithms()This method registers the default algorithms.voidsetSecureValidation(boolean secureValidation)-
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
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
transformSpiHash
private static java.util.Map<java.lang.String,java.lang.Class<? extends TransformSpi>> transformSpiHash
All available Transform classes are registered here
-
transformSpi
private final TransformSpi transformSpi
-
secureValidation
private boolean secureValidation
-
-
Constructor Detail
-
Transform
public Transform(org.w3c.dom.Document doc, java.lang.String algorithmURI) throws InvalidTransformExceptionGenerates 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(org.w3c.dom.Document doc, java.lang.String algorithmURI, org.w3c.dom.Element contextChild) throws InvalidTransformExceptionGenerates 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(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 algorithmcontextNodes- the child node list ofTransformelement- Throws:
InvalidTransformException
-
Transform
public Transform(org.w3c.dom.Element element, java.lang.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(java.lang.String algorithmURI, java.lang.String implementingClass) throws AlgorithmAlreadyRegisteredException, java.lang.ClassNotFoundException, InvalidTransformExceptionRegisters 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 registeredjava.lang.SecurityException- if a security manager is installed and the caller does not have permission to register the transformjava.lang.ClassNotFoundExceptionInvalidTransformException
-
register
public static void register(java.lang.String algorithmURI, java.lang.Class<? extends TransformSpi> implementingClass) throws AlgorithmAlreadyRegisteredExceptionRegisters 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 registeredjava.lang.SecurityException- 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 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 generatesXMLSignatureInputas output.- Parameters:
input- inputXMLSignatureInputwhich can supplied Octet 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 generatesXMLSignatureInputas 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()
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- the localname of the Elements of the sub-class.
-
initializeTransform
private TransformSpi initializeTransform(java.lang.String algorithmURI, org.w3c.dom.NodeList contextNodes) throws InvalidTransformException
Initialize the transform object.- Throws:
InvalidTransformException
-
isSecureValidation
public boolean isSecureValidation()
-
setSecureValidation
public void setSecureValidation(boolean secureValidation)
-
-