TransformSpi.java revision 0
0N/A/*
2362N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A
0N/A/*
2362N/A * Copyright 1999-2004 The Apache Software Foundation.
0N/A *
2362N/A * Licensed under the Apache License, Version 2.0 (the "License");
0N/A * you may not use this file except in compliance with the License.
0N/A * You may obtain a copy of the License at
0N/A *
0N/A * http://www.apache.org/licenses/LICENSE-2.0
0N/A *
0N/A * Unless required by applicable law or agreed to in writing, software
0N/A * distributed under the License is distributed on an "AS IS" BASIS,
0N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A * See the License for the specific language governing permissions and
0N/A * limitations under the License.
0N/A *
2362N/A */
2362N/Apackage com.sun.org.apache.xml.internal.security.transforms;
2362N/A
0N/A
0N/A
0N/Aimport java.io.IOException;
0N/Aimport java.io.OutputStream;
0N/A
0N/Aimport javax.xml.parsers.ParserConfigurationException;
406N/A
0N/Aimport com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
406N/Aimport com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException;
406N/Aimport com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
406N/Aimport org.xml.sax.SAXException;
406N/A
0N/A
0N/A/**
0N/A * Base class which all Transform algorithms extend. The common methods that
0N/A * have to be overridden are the {@link #enginePerformTransform(XMLSignatureInput)} method.
0N/A *
0N/A * @author Christian Geuer-Pollmann
0N/A */
406N/Apublic abstract class TransformSpi {
0N/A
0N/A /** {@link java.util.logging} logging facility */
406N/A static java.util.logging.Logger log =
0N/A java.util.logging.Logger.getLogger(TransformSpi.class.getName());
406N/A
0N/A protected Transform _transformObject = null;
0N/A protected void setTransform(Transform transform) {
0N/A this._transformObject = transform;
0N/A }
0N/A
0N/A /**
0N/A * The mega method which MUST be implemented by the Transformation Algorithm.
0N/A *
0N/A * @param input {@link XMLSignatureInput} as the input of transformation
0N/A * @param os where to output this transformation.
0N/A * @return {@link XMLSignatureInput} as the result of transformation
0N/A * @throws CanonicalizationException
0N/A * @throws IOException
406N/A * @throws InvalidCanonicalizerException
0N/A * @throws ParserConfigurationException
0N/A * @throws SAXException
0N/A * @throws TransformationException
0N/A */
0N/A protected XMLSignatureInput enginePerformTransform(
0N/A XMLSignatureInput input, OutputStream os)
0N/A throws IOException,
0N/A CanonicalizationException, InvalidCanonicalizerException,
467N/A TransformationException, ParserConfigurationException,
467N/A SAXException {
467N/A return enginePerformTransform(input);
467N/A }
467N/A /**
467N/A * The mega method which MUST be implemented by the Transformation Algorithm.
467N/A *
467N/A * @param input {@link XMLSignatureInput} as the input of transformation
467N/A * @return {@link XMLSignatureInput} as the result of transformation
467N/A * @throws CanonicalizationException
467N/A * @throws IOException
467N/A * @throws InvalidCanonicalizerException
467N/A * @throws ParserConfigurationException
0N/A * @throws SAXException
0N/A * @throws TransformationException
0N/A */
0N/A protected abstract XMLSignatureInput enginePerformTransform(
0N/A XMLSignatureInput input)
0N/A throws IOException,
0N/A CanonicalizationException, InvalidCanonicalizerException,
0N/A TransformationException, ParserConfigurationException,
0N/A SAXException;
0N/A
0N/A /**
0N/A * Returns the URI representation of <code>Transformation algorithm</code>
0N/A *
0N/A * @return the URI representation of <code>Transformation algorithm</code>
0N/A */
0N/A protected abstract String engineGetURI();
0N/A}
0N/A