1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
/* Transformer.java --
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.xml.transform;
import java.util.Properties;
/**
* An XSL transformation.
* Instances of this class may be reused, but the same instance may not be
* used concurrently by different threads.
*
* @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class Transformer
{
protected Transformer()
{
}
/**
* Transforms the source XML to a result tree.
* @param xmlSource the XML source
* @param outputTarget the result of the transformation
*/
public abstract void transform(Source xmlSource, Result outputTarget)
throws TransformerException;
/**
* Sets a parameter value for the transformation.
* Parameters may be referenced in the XSLT stylesheet.
* @param name the parameter name (an XML Name, or a namespace-prefixed
* XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
* @param value the value to assign
*/
public abstract void setParameter(String name, Object value);
/**
* Returns the specified parameter value.
* @param name the parameter name (an XML Name, or a namespace-prefixed
* XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
*/
public abstract Object getParameter(String name);
/**
* Clears all parameter values.
*/
public abstract void clearParameters();
/**
* Sets the callback used to resolve entities referenced by
* <code>xsl:include</code>, <code>xsl:import</code>, or the XPath
* <code>document()</code> function.
*/
public abstract void setURIResolver(URIResolver resolver);
/**
* Returns the callback used to resolve entities referenced by
* <code>xsl:include</code>, <code>xsl:import</code>, or the XPath
* <code>document()</code> function.
*/
public abstract URIResolver getURIResolver();
/**
* Sets the output properties for the transformation, overriding any
* properties defined in the stylesheet.
* The format of property keys is as in the
* {@link #setOutputProperty(java.lang.String,java.lang.String)} method.
* @param oformat a set of output properties, or null to reset all the
* properties to their default values
*/
public abstract void setOutputProperties(Properties oformat)
throws IllegalArgumentException;
/**
* Returns a copy of the output properties for the transformation.
* Missing properties are defaulted according the
* <a href='http://www.w3.org/TR/xslt#output'>XSLT Recommendation, section
* 16</a>: <code>getProperty(String)</code> returns all properties
* including defaulted ones, and <code>get(Object)</code> returns only the
* properties explicitly set in the stylesheet.
*/
public abstract Properties getOutputProperties();
/**
* Sets an output property for the transformation, overriding any property
* of the same name defined in the stylesheet.
* @param name the property name (an XML Name, or a namespace-prefixed
* XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
* @param value the string value of the property
* @exception IllegalArgumentException if the property is not supported
*/
public abstract void setOutputProperty(String name, String value)
throws IllegalArgumentException;
/**
* Returns the value of an output property for the transformation.
* Only explicit properties set programmatically or defined in the
* stylesheet, not defaulted properties, are returned by this method.
* @param name the property name (an XML Name, or a namespace-prefixed
* XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
* @exception IllegalArgumentException if the property is not supported
*/
public abstract String getOutputProperty(String name)
throws IllegalArgumentException;
/**
* Sets the callback used to report errors during the transformation.
* @exception IllegalArgumentException if the listener is null
*/
public abstract void setErrorListener(ErrorListener listener)
throws IllegalArgumentException;
/**
* Returns the callback used to report errors during the transformation.
*/
public abstract ErrorListener getErrorListener();
// -- JAXP 1.3 methods --
/**
* Reset this Transformer to its original configuration.
* @since 1.3
*/
public void reset()
{
}
}
|