KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > security > transforms > TransformSpi


1
2 /*
3  * Copyright 1999-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */

18 package com.sun.org.apache.xml.internal.security.transforms;
19
20
21
22 import java.io.IOException JavaDoc;
23 import java.io.OutputStream JavaDoc;
24
25 import javax.xml.parsers.ParserConfigurationException JavaDoc;
26
27 import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
28 import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException;
29 import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
30 import org.xml.sax.SAXException JavaDoc;
31
32
33 /**
34  * Base class which all Transform algorithms extend. The common methods that
35  * have to be overridden are the {@link #enginePerformTransform(XMLSignatureInput)} method.
36  *
37  * @author Christian Geuer-Pollmann
38  */

39 public abstract class TransformSpi {
40
41    /** {@link java.util.logging} logging facility */
42     static java.util.logging.Logger JavaDoc log =
43         java.util.logging.Logger.getLogger(TransformSpi.class.getName());
44
45    protected Transform _transformObject = null;
46    protected void setTransform(Transform transform) {
47       this._transformObject = transform;
48    }
49
50    /**
51     * The mega method which MUST be implemented by the Transformation Algorithm.
52     *
53     * @param input {@link XMLSignatureInput} as the input of transformation
54     * @param os where to output this transformation.
55     * @return {@link XMLSignatureInput} as the result of transformation
56     * @throws CanonicalizationException
57     * @throws IOException
58     * @throws InvalidCanonicalizerException
59     * @throws ParserConfigurationException
60     * @throws SAXException
61     * @throws TransformationException
62     */

63    protected XMLSignatureInput enginePerformTransform(
64       XMLSignatureInput input, OutputStream JavaDoc os)
65          throws IOException JavaDoc,
66                 CanonicalizationException, InvalidCanonicalizerException,
67                 TransformationException, ParserConfigurationException JavaDoc,
68                 SAXException JavaDoc {
69         return enginePerformTransform(input);
70    }
71    /**
72     * The mega method which MUST be implemented by the Transformation Algorithm.
73     *
74     * @param input {@link XMLSignatureInput} as the input of transformation
75     * @return {@link XMLSignatureInput} as the result of transformation
76     * @throws CanonicalizationException
77     * @throws IOException
78     * @throws InvalidCanonicalizerException
79     * @throws ParserConfigurationException
80     * @throws SAXException
81     * @throws TransformationException
82     */

83    protected abstract XMLSignatureInput enginePerformTransform(
84       XMLSignatureInput input)
85          throws IOException JavaDoc,
86                 CanonicalizationException, InvalidCanonicalizerException,
87                 TransformationException, ParserConfigurationException JavaDoc,
88                 SAXException JavaDoc;
89
90    /**
91     * Returns the URI representation of <code>Transformation algorithm</code>
92     *
93     * @return the URI representation of <code>Transformation algorithm</code>
94     */

95    protected abstract String JavaDoc engineGetURI();
96 }
97
Popular Tags