1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  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// $Id: TransformerHandler.java 446598 2006-09-15 12:55:40Z jeremias $
19
20package javax.xml.transform.sax;
21
22import javax.xml.transform.Result;
23import javax.xml.transform.Transformer;
24import org.xml.sax.ContentHandler;
25import org.xml.sax.DTDHandler;
26import org.xml.sax.ext.LexicalHandler;
27
28/**
29 * A TransformerHandler
30 * listens for SAX ContentHandler parse events and transforms
31 * them to a Result.
32 */
33public interface TransformerHandler
34    extends ContentHandler, LexicalHandler, DTDHandler {
35
36    /**
37     * <p>Set  the <code>Result</code> associated with this
38     * <code>TransformerHandler</code> to be used for the transformation.</p>
39     *
40     * @param result A <code>Result</code> instance, should not be
41     *   <code>null</code>.
42     *
43     * @throws IllegalArgumentException if result is invalid for some reason.
44     */
45    public void setResult(Result result) throws IllegalArgumentException;
46
47    /**
48     * Set the base ID (URI or system ID) from where relative
49     * URLs will be resolved.
50     * @param systemID Base URI for the source tree.
51     */
52    public void setSystemId(String systemID);
53
54    /**
55     * Get the base ID (URI or system ID) from where relative
56     * URLs will be resolved.
57     * @return The systemID that was set with {@link #setSystemId}.
58     */
59    public String getSystemId();
60
61    /**
62     * <p>Get the <code>Transformer</code> associated with this handler, which
63     * is needed in order to set parameters and output properties.</p>
64     *
65     * @return <code>Transformer</code> associated with this
66     *   <code>TransformerHandler</code>.
67     */
68    public Transformer getTransformer();
69}
70