~ubuntu-branches/ubuntu/karmic/libjaxp1.3-java/karmic

« back to all changes in this revision

Viewing changes to javax/xml/transform/sax/SAXTransformerFactory.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-08-03 10:30:58 UTC
  • Revision ID: james.westby@ubuntu.com-20060803103058-7jwwiqv9g8w9094d
Tags: upstream-1.3.03
ImportĀ upstreamĀ versionĀ 1.3.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2003-2004 The Apache Software Foundation.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
// $Id: SAXTransformerFactory.java 226183 2005-04-08 10:39:14Z neeraj $
 
18
 
 
19
package javax.xml.transform.sax;
 
20
 
 
21
import javax.xml.transform.*;
 
22
 
 
23
import org.xml.sax.XMLFilter;
 
24
 
 
25
/**
 
26
 * This class extends TransformerFactory to provide SAX-specific
 
27
 * factory methods.  It provides two types of ContentHandlers,
 
28
 * one for creating Transformers, the other for creating Templates
 
29
 * objects.
 
30
 *
 
31
 * <p>If an application wants to set the ErrorHandler or EntityResolver
 
32
 * for an XMLReader used during a transformation, it should use a URIResolver
 
33
 * to return the SAXSource which provides (with getXMLReader) a reference to
 
34
 * the XMLReader.</p>
 
35
 */
 
36
public abstract class SAXTransformerFactory extends TransformerFactory {
 
37
 
 
38
    /** If {@link javax.xml.transform.TransformerFactory#getFeature}
 
39
     * returns true when passed this value as an argument,
 
40
     * the TransformerFactory returned from
 
41
     * {@link javax.xml.transform.TransformerFactory#newInstance} may
 
42
     * be safely cast to a SAXTransformerFactory.
 
43
     */
 
44
    public static final String FEATURE =
 
45
        "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
 
46
 
 
47
    /** If {@link javax.xml.transform.TransformerFactory#getFeature}
 
48
     * returns true when passed this value as an argument,
 
49
     * the {@link #newXMLFilter(Source src)}
 
50
     * and {@link #newXMLFilter(Templates templates)} methods are supported.
 
51
     */
 
52
    public static final String FEATURE_XMLFILTER =
 
53
        "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
 
54
 
 
55
    /**
 
56
     * The default constructor is protected on purpose.
 
57
     */
 
58
    protected SAXTransformerFactory() {}
 
59
 
 
60
    /**
 
61
     * Get a TransformerHandler object that can process SAX
 
62
     * ContentHandler events into a Result, based on the transformation
 
63
     * instructions specified by the argument.
 
64
     *
 
65
     * @param src The Source of the transformation instructions.
 
66
     *
 
67
     * @return TransformerHandler ready to transform SAX events.
 
68
     *
 
69
     * @throws TransformerConfigurationException If for some reason the
 
70
     * TransformerHandler can not be created.
 
71
     */
 
72
    public abstract TransformerHandler newTransformerHandler(Source src)
 
73
        throws TransformerConfigurationException;
 
74
 
 
75
    /**
 
76
     * Get a TransformerHandler object that can process SAX
 
77
     * ContentHandler events into a Result, based on the Templates argument.
 
78
     *
 
79
     * @param templates The compiled transformation instructions.
 
80
     *
 
81
     * @return TransformerHandler ready to transform SAX events.
 
82
     *
 
83
     * @throws TransformerConfigurationException If for some reason the
 
84
     * TransformerHandler can not be created.
 
85
     */
 
86
    public abstract TransformerHandler newTransformerHandler(
 
87
        Templates templates) throws TransformerConfigurationException;
 
88
 
 
89
    /**
 
90
     * Get a TransformerHandler object that can process SAX
 
91
     * ContentHandler events into a Result. The transformation
 
92
     * is defined as an identity (or copy) transformation, for example
 
93
     * to copy a series of SAX parse events into a DOM tree.
 
94
     *
 
95
     * @return A non-null reference to a TransformerHandler, that may
 
96
     * be used as a ContentHandler for SAX parse events.
 
97
     *
 
98
     * @throws TransformerConfigurationException If for some reason the
 
99
     * TransformerHandler cannot be created.
 
100
     */
 
101
    public abstract TransformerHandler newTransformerHandler()
 
102
        throws TransformerConfigurationException;
 
103
 
 
104
    /**
 
105
     * Get a TemplatesHandler object that can process SAX
 
106
     * ContentHandler events into a Templates object.
 
107
     *
 
108
     * @return A non-null reference to a TransformerHandler, that may
 
109
     * be used as a ContentHandler for SAX parse events.
 
110
     *
 
111
     * @throws TransformerConfigurationException If for some reason the
 
112
     * TemplatesHandler cannot be created.
 
113
     */
 
114
    public abstract TemplatesHandler newTemplatesHandler()
 
115
        throws TransformerConfigurationException;
 
116
 
 
117
    /**
 
118
     * Create an XMLFilter that uses the given Source as the
 
119
     * transformation instructions.
 
120
     *
 
121
     * @param src The Source of the transformation instructions.
 
122
     *
 
123
     * @return An XMLFilter object, or null if this feature is not supported.
 
124
     *
 
125
     * @throws TransformerConfigurationException If for some reason the
 
126
     * TemplatesHandler cannot be created.
 
127
     */
 
128
    public abstract XMLFilter newXMLFilter(Source src)
 
129
        throws TransformerConfigurationException;
 
130
 
 
131
    /**
 
132
     * Create an XMLFilter, based on the Templates argument..
 
133
     *
 
134
     * @param templates The compiled transformation instructions.
 
135
     *
 
136
     * @return An XMLFilter object, or null if this feature is not supported.
 
137
     *
 
138
     * @throws TransformerConfigurationException If for some reason the
 
139
     * TemplatesHandler cannot be created.
 
140
     */
 
141
    public abstract XMLFilter newXMLFilter(Templates templates)
 
142
        throws TransformerConfigurationException;
 
143
}