jaxp/src/share/classes/javax/xml/parsers/SAXParser.java
author jjg
Thu, 19 Jun 2008 15:52:31 -0700
changeset 811 687d51cb403b
parent 6 7f561c08de6b
permissions -rw-r--r--
6716866: some javac regression tests fail to compile with re-orged file manager Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
package javax.xml.parsers;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import java.io.File;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import java.io.InputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import javax.xml.validation.Schema;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
import org.xml.sax.HandlerBase;
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
import org.xml.sax.InputSource;
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
import org.xml.sax.Parser;
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
import org.xml.sax.SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
import org.xml.sax.SAXNotRecognizedException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
import org.xml.sax.SAXNotSupportedException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
import org.xml.sax.XMLReader;
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
import org.xml.sax.helpers.DefaultHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * Defines the API that wraps an {@link org.xml.sax.XMLReader}
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * implementation class. In JAXP 1.0, this class wrapped the
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * {@link org.xml.sax.Parser} interface, however this interface was
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * replaced by the {@link org.xml.sax.XMLReader}. For ease
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * of transition, this class continues to support the same name
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * and interface as well as supporting new methods.
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * An instance of this class can be obtained from the
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * {@link javax.xml.parsers.SAXParserFactory#newSAXParser()} method.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * Once an instance of this class is obtained, XML can be parsed from
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * a variety of input sources. These input sources are InputStreams,
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * Files, URLs, and SAX InputSources.<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * This static method creates a new factory instance based
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * on a system property setting or uses the platform default
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * if no property has been defined.<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * The system property that controls which Factory implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * to create is named <code>&quot;javax.xml.parsers.SAXParserFactory&quot;</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * This property names a class that is a concrete subclass of this
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 * abstract class. If no property is defined, a platform default
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * will be used.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * As the content is parsed by the underlying parser, methods of the
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * given {@link org.xml.sax.HandlerBase} or the
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * {@link org.xml.sax.helpers.DefaultHandler} are called.<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 * Implementors of this class which wrap an underlaying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * can consider using the {@link org.xml.sax.helpers.ParserAdapter}
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * class to initially adapt their SAX1 implementation to work under
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 * this revised class.
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
public abstract class SAXParser {
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * <p>Protected constructor to prevent instaniation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     * Use {@link javax.xml.parsers.SAXParserFactory#newSAXParser()}.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
    protected SAXParser () {
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
         * <p>Reset this <code>SAXParser</code> to its original configuration.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
         * <p><code>SAXParser</code> is reset to the same state as when it was created with
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
         * {@link SAXParserFactory#newSAXParser()}.
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
         * <code>reset()</code> is designed to allow the reuse of existing <code>SAXParser</code>s
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
         * thus saving resources associated with the creation of new <code>SAXParser</code>s.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
         * <p>The reset <code>SAXParser</code> is not guaranteed to have the same {@link Schema}
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
         * <code>Object</code>, e.g. {@link Object#equals(Object obj)}.  It is guaranteed to have a functionally equal
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
         * <code>Schema</code>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * @throws UnsupportedOperationException When Implementations do not
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     *   override this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
         * @since 1.5
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
        public void reset() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
                // implementors should override this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
                throw new UnsupportedOperationException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
                        "This SAXParser, \"" + this.getClass().getName() + "\", does not support the reset functionality."
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
                        + "  Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
                        + " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
                        );
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     * <p>Parse the content of the given {@link java.io.InputStream}
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     * instance as XML using the specified {@link org.xml.sax.HandlerBase}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     * <i> Use of the DefaultHandler version of this method is recommended as
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     * the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     * @param is InputStream containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     * @param hb The SAX HandlerBase to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     * @throws IllegalArgumentException If the given InputStream is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     * @throws SAXException If parse produces a SAX error.
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     * @throws IOException If an IO error occurs interacting with the
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     *   <code>InputStream</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    public void parse(InputStream is, HandlerBase hb)
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
            throw new IllegalArgumentException("InputStream cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
        InputSource input = new InputSource(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
        this.parse(input, hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
     * <p>Parse the content of the given {@link java.io.InputStream}
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
     * instance as XML using the specified {@link org.xml.sax.HandlerBase}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
     * <i> Use of the DefaultHandler version of this method is recommended as
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     * the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     * @param is InputStream containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * @param hb The SAX HandlerBase to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * @param systemId The systemId which is needed for resolving relative URIs.
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * @throws IllegalArgumentException If the given <code>InputStream</code> is
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     *   <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     * @throws IOException If any IO error occurs interacting with the
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
     *   <code>InputStream</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     * @see org.xml.sax.DocumentHandler version of this method instead.
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
    public void parse(
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
        InputStream is,
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
        HandlerBase hb,
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
        String systemId)
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
            throw new IllegalArgumentException("InputStream cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
        InputSource input = new InputSource(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
        input.setSystemId(systemId);
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
        this.parse(input, hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
     * Parse the content of the given {@link java.io.InputStream}
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * instance as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     * {@link org.xml.sax.helpers.DefaultHandler}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
     * @param is InputStream containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
     * @param dh The SAX DefaultHandler to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
     * @throws IllegalArgumentException If the given InputStream is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
    public void parse(InputStream is, DefaultHandler dh)
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
            throw new IllegalArgumentException("InputStream cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
        InputSource input = new InputSource(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
        this.parse(input, dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     * Parse the content of the given {@link java.io.InputStream}
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     * instance as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     * {@link org.xml.sax.helpers.DefaultHandler}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
     * @param is InputStream containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
     * @param dh The SAX DefaultHandler to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
     * @param systemId The systemId which is needed for resolving relative URIs.
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
     * @throws IllegalArgumentException If the given InputStream is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     * @see org.xml.sax.DocumentHandler version of this method instead.
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
    public void parse(
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
        InputStream is,
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
        DefaultHandler dh,
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
        String systemId)
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
            throw new IllegalArgumentException("InputStream cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
        InputSource input = new InputSource(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
        input.setSystemId(systemId);
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
        this.parse(input, dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
     * Parse the content described by the giving Uniform Resource
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
     * Identifier (URI) as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
     * {@link org.xml.sax.HandlerBase}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
     * <i> Use of the DefaultHandler version of this method is recommended as
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
     * the <code>HandlerBase</code> class has been deprecated in SAX 2.0</i>
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
     * @param uri The location of the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
     * @param hb The SAX HandlerBase to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
     * @throws IllegalArgumentException If the uri is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
    public void parse(String uri, HandlerBase hb)
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
        if (uri == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
            throw new IllegalArgumentException("uri cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
        InputSource input = new InputSource(uri);
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
        this.parse(input, hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
     * Parse the content described by the giving Uniform Resource
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
     * Identifier (URI) as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
     * {@link org.xml.sax.helpers.DefaultHandler}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
     * @param uri The location of the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
     * @param dh The SAX DefaultHandler to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
     * @throws IllegalArgumentException If the uri is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
    public void parse(String uri, DefaultHandler dh)
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
        if (uri == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
            throw new IllegalArgumentException("uri cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
        InputSource input = new InputSource(uri);
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
        this.parse(input, dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
     * Parse the content of the file specified as XML using the
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
     * specified {@link org.xml.sax.HandlerBase}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
     * <i> Use of the DefaultHandler version of this method is recommended as
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
     * the HandlerBase class has been deprecated in SAX 2.0</i>
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
     * @param f The file containing the XML to parse
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
     * @param hb The SAX HandlerBase to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
     * @throws IllegalArgumentException If the File object is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
    public void parse(File f, HandlerBase hb)
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
        if (f == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
            throw new IllegalArgumentException("File cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
        //convert file to appropriate URI, f.toURI().toASCIIString()
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
        //converts the URI to string as per rule specified in
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
        //RFC 2396,
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
        InputSource input = new InputSource(f.toURI().toASCIIString());
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
        this.parse(input, hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
     * Parse the content of the file specified as XML using the
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
     * specified {@link org.xml.sax.helpers.DefaultHandler}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
     * @param f The file containing the XML to parse
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
     * @param dh The SAX DefaultHandler to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
     * @throws IllegalArgumentException If the File object is null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
    public void parse(File f, DefaultHandler dh)
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
        if (f == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
            throw new IllegalArgumentException("File cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
        //convert file to appropriate URI, f.toURI().toASCIIString()
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
        //converts the URI to string as per rule specified in
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
        //RFC 2396,
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
        InputSource input = new InputSource(f.toURI().toASCIIString());
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
        this.parse(input, dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
     * Parse the content given {@link org.xml.sax.InputSource}
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
     * as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
     * {@link org.xml.sax.HandlerBase}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
     * <i> Use of the DefaultHandler version of this method is recommended as
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
     * the HandlerBase class has been deprecated in SAX 2.0</i>
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
     * @param is The InputSource containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
     * @param hb The SAX HandlerBase to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
     * @throws IllegalArgumentException If the <code>InputSource</code> object
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
     *   is <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
    public void parse(InputSource is, HandlerBase hb)
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
            throw new IllegalArgumentException("InputSource cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
        Parser parser = this.getParser();
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
        if (hb != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
            parser.setDocumentHandler(hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
            parser.setEntityResolver(hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
            parser.setErrorHandler(hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
            parser.setDTDHandler(hb);
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
        parser.parse(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
     * Parse the content given {@link org.xml.sax.InputSource}
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
     * as XML using the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
     * {@link org.xml.sax.helpers.DefaultHandler}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
     * @param is The InputSource containing the content to be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
     * @param dh The SAX DefaultHandler to use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
     * @throws IllegalArgumentException If the <code>InputSource</code> object
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
     *   is <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
     * @throws IOException If any IO errors occur.
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
     * @see org.xml.sax.DocumentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
    public void parse(InputSource is, DefaultHandler dh)
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
        throws SAXException, IOException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
        if (is == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
            throw new IllegalArgumentException("InputSource cannot be null");
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
        XMLReader reader = this.getXMLReader();
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
        if (dh != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
            reader.setContentHandler(dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
            reader.setEntityResolver(dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
            reader.setErrorHandler(dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
            reader.setDTDHandler(dh);
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
        reader.parse(is);
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
     * Returns the SAX parser that is encapsultated by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
     * implementation of this class.
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
     * @return The SAX parser that is encapsultated by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
     *         implementation of this class.
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
    public abstract org.xml.sax.Parser getParser() throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
     * Returns the {@link org.xml.sax.XMLReader} that is encapsulated by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
     * implementation of this class.
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
     * @return The XMLReader that is encapsulated by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
     *         implementation of this class.
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
     * @throws SAXException If any SAX errors occur during processing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
    public abstract org.xml.sax.XMLReader getXMLReader() throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
     * Indicates whether or not this parser is configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
     * understand namespaces.
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
     * @return true if this parser is configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
     *         understand namespaces; false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
    public abstract boolean isNamespaceAware();
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
     * Indicates whether or not this parser is configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
     * validate XML documents.
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
     * @return true if this parser is configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
     *         validate XML documents; false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
    public abstract boolean isValidating();
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
     * <p>Sets the particular property in the underlying implementation of
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
     * {@link org.xml.sax.XMLReader}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
     * A list of the core features and properties can be found at
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
     * <a href="http://sax.sourceforge.net/?selected=get-set">
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
     * http://sax.sourceforge.net/?selected=get-set</a>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
     * @param name The name of the property to be set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
     * @param value The value of the property to be set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
     * @throws SAXNotRecognizedException When the underlying XMLReader does
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
     *   not recognize the property name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
     * @throws SAXNotSupportedException When the underlying XMLReader
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
     *  recognizes the property name but doesn't support the property.
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
     * @see org.xml.sax.XMLReader#setProperty
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
    public abstract void setProperty(String name, Object value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
        throws SAXNotRecognizedException, SAXNotSupportedException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
     * <p>Returns the particular property requested for in the underlying
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
     * implementation of {@link org.xml.sax.XMLReader}.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
     * @param name The name of the property to be retrieved.
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
     * @return Value of the requested property.
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
     * @throws SAXNotRecognizedException When the underlying XMLReader does
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
     *    not recognize the property name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
     * @throws SAXNotSupportedException When the underlying XMLReader
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
     *  recognizes the property name but doesn't support the property.
7f561c08de6b Initial load
duke
parents:
diff changeset
   469
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
     * @see org.xml.sax.XMLReader#getProperty
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
    public abstract Object getProperty(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
        throws SAXNotRecognizedException, SAXNotSupportedException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
    /** <p>Get current state of canonicalization.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
     * @return current state canonicalization control
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
    /*
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
    public boolean getCanonicalization() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
        return canonicalState;
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
    */
7f561c08de6b Initial load
duke
parents:
diff changeset
   484
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
    /** <p>Get a reference to the the {@link Schema} being used by
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
     * the XML processor.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
     * <p>If no schema is being used, <code>null</code> is returned.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
     * @return {@link Schema} being used or <code>null</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
     *  if none in use
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
     * @throws UnsupportedOperationException When implementation does not
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
     *   override this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   495
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   496
     * @since 1.5
7f561c08de6b Initial load
duke
parents:
diff changeset
   497
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   498
    public Schema getSchema() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   499
        throw new UnsupportedOperationException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
            "This parser does not support specification \""
7f561c08de6b Initial load
duke
parents:
diff changeset
   501
            + this.getClass().getPackage().getSpecificationTitle()
7f561c08de6b Initial load
duke
parents:
diff changeset
   502
            + "\" version \""
7f561c08de6b Initial load
duke
parents:
diff changeset
   503
            + this.getClass().getPackage().getSpecificationVersion()
7f561c08de6b Initial load
duke
parents:
diff changeset
   504
            + "\""
7f561c08de6b Initial load
duke
parents:
diff changeset
   505
            );
7f561c08de6b Initial load
duke
parents:
diff changeset
   506
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   507
7f561c08de6b Initial load
duke
parents:
diff changeset
   508
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   509
     * <p>Get the XInclude processing mode for this parser.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   510
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   511
     * @return
7f561c08de6b Initial load
duke
parents:
diff changeset
   512
     *      the return value of
7f561c08de6b Initial load
duke
parents:
diff changeset
   513
     *      the {@link SAXParserFactory#isXIncludeAware()}
7f561c08de6b Initial load
duke
parents:
diff changeset
   514
     *      when this parser was created from factory.
7f561c08de6b Initial load
duke
parents:
diff changeset
   515
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   516
     * @throws UnsupportedOperationException When implementation does not
7f561c08de6b Initial load
duke
parents:
diff changeset
   517
     *   override this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   518
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   519
     * @since 1.5
7f561c08de6b Initial load
duke
parents:
diff changeset
   520
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   521
     * @see SAXParserFactory#setXIncludeAware(boolean)
7f561c08de6b Initial load
duke
parents:
diff changeset
   522
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   523
    public boolean isXIncludeAware() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   524
        throw new UnsupportedOperationException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   525
            "This parser does not support specification \""
7f561c08de6b Initial load
duke
parents:
diff changeset
   526
            + this.getClass().getPackage().getSpecificationTitle()
7f561c08de6b Initial load
duke
parents:
diff changeset
   527
            + "\" version \""
7f561c08de6b Initial load
duke
parents:
diff changeset
   528
            + this.getClass().getPackage().getSpecificationVersion()
7f561c08de6b Initial load
duke
parents:
diff changeset
   529
            + "\""
7f561c08de6b Initial load
duke
parents:
diff changeset
   530
            );
7f561c08de6b Initial load
duke
parents:
diff changeset
   531
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   532
}