src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java
author joehw
Wed, 04 Oct 2017 10:54:18 -0700
changeset 47312 d4f959806fe9
parent 47216 71c04702a3d5
child 48412 d4412e380f6b
permissions -rw-r--r--
8187593: Cleanup: removing SecuritySupport files Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     1
/*
45261
8a151bf73222 8180385: Fix HTML5 issues in the java.xml module
jjg
parents: 42390
diff changeset
     2
 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     4
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    10
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    15
 * accompanied this code).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    16
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    20
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    23
 * questions.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    24
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    25
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    26
package javax.xml.validation;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    27
42390
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
    28
import com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory;
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    29
import java.io.File;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    30
import java.net.URL;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    31
import javax.xml.transform.Source;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    32
import javax.xml.transform.stream.StreamSource;
47312
d4f959806fe9 8187593: Cleanup: removing SecuritySupport files
joehw
parents: 47216
diff changeset
    33
import jdk.xml.internal.SecuritySupport;
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    34
import org.w3c.dom.ls.LSResourceResolver;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    35
import org.xml.sax.ErrorHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    36
import org.xml.sax.SAXException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    37
import org.xml.sax.SAXNotRecognizedException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    38
import org.xml.sax.SAXNotSupportedException;
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
    39
import org.xml.sax.SAXParseException;
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    40
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    41
/**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
    42
 * Factory that creates {@link Schema} objects. Entry-point to
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    43
 * the validation API.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    44
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    45
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    46
 * {@link SchemaFactory} is a schema compiler. It reads external
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    47
 * representations of schemas and prepares them for validation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    48
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    49
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    50
 * The {@link SchemaFactory} class is not thread-safe. In other words,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    51
 * it is the application's responsibility to ensure that at most
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    52
 * one thread is using a {@link SchemaFactory} object at any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    53
 * given moment. Implementations are encouraged to mark methods
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
    54
 * as {@code synchronized} to protect themselves from broken clients.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    55
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    56
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    57
 * {@link SchemaFactory} is not re-entrant. While one of the
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
    58
 * {@code newSchema} methods is being invoked, applications
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
    59
 * may not attempt to recursively invoke the {@code newSchema} method,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    60
 * even from the same thread.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    61
 *
45261
8a151bf73222 8180385: Fix HTML5 issues in the java.xml module
jjg
parents: 42390
diff changeset
    62
 * <h2><a id="schemaLanguage"></a>Schema Language</h2>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    63
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    64
 * This spec uses a namespace URI to designate a schema language.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    65
 * The following table shows the values defined by this specification.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    66
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    67
 * To be compliant with the spec, the implementation
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    68
 * is only required to support W3C XML Schema 1.0. However,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    69
 * if it chooses to support other schema languages listed here,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    70
 * it must conform to the relevant behaviors described in this spec.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    71
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    72
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    73
 * Schema languages not listed here are expected to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    74
 * introduce their own URIs to represent themselves.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    75
 * The {@link SchemaFactory} class is capable of locating other
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    76
 * implementations for other schema languages at run-time.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    77
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    78
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    79
 * Note that because the XML DTD is strongly tied to the parsing process
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    80
 * and has a significant effect on the parsing process, it is impossible
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    81
 * to define the DTD validation as a process independent from parsing.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    82
 * For this reason, this specification does not define the semantics for
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
    83
 * the XML DTD. This doesn't prohibit implementors from implementing it
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    84
 * in a way they see fit, but <em>users are warned that any DTD
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    85
 * validation implemented on this interface necessarily deviate from
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    86
 * the XML DTD semantics as defined in the XML 1.0</em>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    87
 *
45261
8a151bf73222 8180385: Fix HTML5 issues in the java.xml module
jjg
parents: 42390
diff changeset
    88
 * <table class="striped">
8a151bf73222 8180385: Fix HTML5 issues in the java.xml module
jjg
parents: 42390
diff changeset
    89
 *   <caption>URIs for Supported Schema languages</caption>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    90
 *   <thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    91
 *     <tr>
45855
46c3f654e80f 8184021: Fix tables in doc comments to be accessible
jjg
parents: 45261
diff changeset
    92
 *       <th scope="col">value</th>
46c3f654e80f 8184021: Fix tables in doc comments to be accessible
jjg
parents: 45261
diff changeset
    93
 *       <th scope="col">language</th>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    94
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    95
 *   </thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    96
 *   <tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    97
 *     <tr>
45855
46c3f654e80f 8184021: Fix tables in doc comments to be accessible
jjg
parents: 45261
diff changeset
    98
 *       <th scope="row">{@link javax.xml.XMLConstants#W3C_XML_SCHEMA_NS_URI} ("{@code http://www.w3.org/2001/XMLSchema}")</th>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    99
 *       <td><a href="http://www.w3.org/TR/xmlschema-1">W3C XML Schema 1.0</a></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   100
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   101
 *     <tr>
45855
46c3f654e80f 8184021: Fix tables in doc comments to be accessible
jjg
parents: 45261
diff changeset
   102
 *       <th scope="row">{@link javax.xml.XMLConstants#RELAXNG_NS_URI} ("{@code http://relaxng.org/ns/structure/1.0}")</th>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   103
 *       <td><a href="http://www.relaxng.org/">RELAX NG 1.0</a></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   104
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   105
 *   </tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   106
 * </table>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   107
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   108
 * @author  <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   109
 * @author  <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   110
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   111
 * @since 1.5
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   112
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   113
public abstract class SchemaFactory {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   114
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   115
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   116
     * Constructor for derived classes.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   117
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   118
     * <p>The constructor does nothing.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   119
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   120
     * <p>Derived classes must create {@link SchemaFactory} objects that have
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   121
     * {@code null} {@link ErrorHandler} and
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   122
     * {@code null} {@link LSResourceResolver}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   123
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   124
    protected SchemaFactory() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   125
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   126
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   127
    /**
42390
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   128
     * Creates a new instance of the {@code SchemaFactory} builtin
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   129
     * system-default implementation.
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   130
     *
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   131
     * @implSpec The {@code SchemaFactory} builtin
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   132
     * system-default implementation is only required to support the
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   133
     * <a href="http://www.w3.org/TR/xmlschema-1">W3C XML Schema 1.0</a>,
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   134
     * but may support additional <a href="#schemaLanguage">schema languages</a>.
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   135
     *
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   136
     * @return A new instance of the {@code SchemaFactory} builtin
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   137
     *         system-default implementation.
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   138
     *
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   139
     * @since 9
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   140
     */
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   141
    public static SchemaFactory newDefaultInstance() {
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   142
        return XMLSchemaFactory.newXMLSchemaFactoryNoServiceLoader();
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   143
    }
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   144
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   145
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   146
     * Lookup an implementation of the {@code SchemaFactory} that supports the specified
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   147
     * schema language and return it.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   148
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   149
     * <p>To find a {@code SchemaFactory} object for a given schema language,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   150
     * this method looks the following places in the following order
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   151
     * where "the class loader" refers to the context class loader:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   152
     * <ol>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   153
     *  <li>
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   154
     *     <p>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   155
     *     If the system property
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   156
     *     {@code "javax.xml.validation.SchemaFactory:<i>schemaLanguage</i>"}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   157
     *     is present (where <i>schemaLanguage</i> is the parameter
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   158
     *     to this method), then its value is read
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   159
     *     as a class name. The method will try to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   160
     *     create a new instance of this class by using the class loader,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   161
     *     and returns it if it is successfully created.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   162
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   163
     *   <li>
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   164
     *     <p>
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   165
     *     Use the configuration file "jaxp.properties". The file is in standard
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   166
     *     {@link java.util.Properties} format and typically located in the
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   167
     *     conf directory of the Java installation. It contains the fully qualified
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   168
     *     name of the implementation class with the key being the system property
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   169
     *     defined above.
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   170
     *     <p>
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   171
     *     The jaxp.properties file is read only once by the JAXP implementation
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   172
     *     and its values are then cached for future use.  If the file does not exist
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   173
     *     when the first attempt is made to read from it, no further attempts are
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   174
     *     made to check for its existence.  It is not possible to change the value
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   175
     *     of any property in jaxp.properties after it has been read for the first time.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   176
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   177
     *   <li>
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   178
     *   <p>
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   179
     *   Use the service-provider loading facility, defined by the
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   180
     *   {@link java.util.ServiceLoader} class, to attempt to locate and load an
20581
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   181
     *   implementation of the service using the {@linkplain
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   182
     *   java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   183
     *   the service-provider loading facility will use the {@linkplain
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   184
     *   java.lang.Thread#getContextClassLoader() current thread's context class loader}
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   185
     *   to attempt to load the service. If the context class
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   186
     *   loader is null, the {@linkplain
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   187
     *   ClassLoader#getSystemClassLoader() system class loader} will be used.
65d17ea72da3 8025745: Clarify API documentation of JAXP factories.
dfuchs
parents: 17534
diff changeset
   188
     *   <br>
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   189
     *   Each potential service provider is required to implement the method
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   190
     *        {@link #isSchemaLanguageSupported(String schemaLanguage)}.
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   191
     *   <br>
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   192
     *   The first service provider found that supports the specified schema
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   193
     *   language is returned.
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   194
     *   <br>
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   195
     *   In case of {@link java.util.ServiceConfigurationError} a
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   196
     *   {@link SchemaFactoryConfigurationError} will be thrown.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   197
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   198
     *   <li>
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   199
     *     <p>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   200
     *     Platform default {@code SchemaFactory} is located
42390
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   201
     *     in an implementation specific way. There must be a
4083bc2c3b5b 8169778: Add new public methods to get new instances of the JAXP factories builtin system-default implementations
dfuchs
parents: 29999
diff changeset
   202
     *     {@linkplain #newDefaultInstance() platform default}
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   203
     *     {@code SchemaFactory} for W3C XML Schema.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   204
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   205
     * </ol>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   206
     *
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   207
     * <p>If everything fails, {@link IllegalArgumentException} will be thrown.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   208
     *
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   209
     * <p><strong>Tip for Trouble-shooting:</strong>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   210
     * <p>See {@link java.util.Properties#load(java.io.InputStream)} for
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   211
     * exactly how a property file is parsed. In particular, colons ':'
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   212
     * need to be escaped in a property file, so make sure schema language
29419
534054ee6062 8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents: 27574
diff changeset
   213
     * URIs are properly escaped in it. For example:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   214
     * <pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   215
     * http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   216
     * </pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   217
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   218
     * @param schemaLanguage
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   219
     *      Specifies the schema language which the returned
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   220
     *      SchemaFactory will understand. See
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   221
     *      <a href="#schemaLanguage">the list of available
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   222
     *      schema languages</a> for the possible values.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   223
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   224
     * @return New instance of a {@code SchemaFactory}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   225
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   226
     * @throws IllegalArgumentException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   227
     *      If no implementation of the schema language is available.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   228
     * @throws NullPointerException
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   229
     *      If the {@code schemaLanguage} parameter is null.
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   230
     * @throws SchemaFactoryConfigurationError
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   231
     *      If a configuration error is encountered.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   232
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   233
     * @see #newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   234
     */
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   235
    public static SchemaFactory newInstance(String schemaLanguage) {
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   236
        ClassLoader cl;
47312
d4f959806fe9 8187593: Cleanup: removing SecuritySupport files
joehw
parents: 47216
diff changeset
   237
        cl = SecuritySupport.getContextClassLoader();
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   238
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   239
        if (cl == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   240
            //cl = ClassLoader.getSystemClassLoader();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   241
            //use the current class loader
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   242
            cl = SchemaFactory.class.getClassLoader();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   243
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   244
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   245
        SchemaFactory f = new SchemaFactoryFinder(cl).newFactory(schemaLanguage);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   246
        if (f == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   247
            throw new IllegalArgumentException(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   248
                    "No SchemaFactory"
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   249
                    + " that implements the schema language specified by: " + schemaLanguage
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   250
                    + " could be loaded");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   251
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   252
        return f;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   253
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   254
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   255
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   256
     * Obtain a new instance of a {@code SchemaFactory} from class name. {@code SchemaFactory}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   257
     * is returned if specified factory class name supports the specified schema language.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   258
     * This function is useful when there are multiple providers in the classpath.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   259
     * It gives more control to the application as it can specify which provider
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   260
     * should be loaded.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   261
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   262
     * <h2>Tip for Trouble-shooting</h2>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   263
     * <p>Setting the {@code jaxp.debug} system property will cause
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   264
     * this method to print a lot of debug messages
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   265
     * to {@code System.err} about what it is doing and where it is looking at.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   266
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   267
     * <p> If you have problems try:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   268
     * <pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   269
     * java -Djaxp.debug=1 YourProgram ....
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   270
     * </pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   271
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   272
     * @param schemaLanguage Specifies the schema language which the returned
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   273
     *                          {@code SchemaFactory} will understand. See
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   274
     *                          <a href="#schemaLanguage">the list of available
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   275
     *                          schema languages</a> for the possible values.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   276
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   277
     * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.validation.SchemaFactory}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   278
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   279
     * @param classLoader {@code ClassLoader} used to load the factory class. If {@code null}
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   280
     *                     current {@code Thread}'s context classLoader is used to load the factory class.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   281
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   282
     * @return New instance of a {@code SchemaFactory}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   283
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   284
     * @throws IllegalArgumentException
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   285
     *                   if {@code factoryClassName} is {@code null}, or
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   286
     *                   the factory class cannot be loaded, instantiated or doesn't
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   287
     *                   support the schema language specified in {@code schemLanguage}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   288
     *                   parameter.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   289
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   290
     * @throws NullPointerException
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   291
     *      If the {@code schemaLanguage} parameter is null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   292
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   293
     * @see #newInstance(String schemaLanguage)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   294
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   295
     * @since 1.6
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   296
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   297
    public static SchemaFactory newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   298
        ClassLoader cl = classLoader;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   299
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   300
        if (cl == null) {
47312
d4f959806fe9 8187593: Cleanup: removing SecuritySupport files
joehw
parents: 47216
diff changeset
   301
            cl = SecuritySupport.getContextClassLoader();
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   302
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   303
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   304
        SchemaFactory f = new SchemaFactoryFinder(cl).createInstance(factoryClassName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   305
        if (f == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   306
            throw new IllegalArgumentException(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   307
                    "Factory " + factoryClassName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   308
                    + " could not be loaded to implement the schema language specified by: " + schemaLanguage);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   309
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   310
        //if this factory supports the given schemalanguage return this factory else thrown exception
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   311
        if(f.isSchemaLanguageSupported(schemaLanguage)){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   312
            return f;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   313
        }else{
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   314
            throw new IllegalArgumentException(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   315
                    "Factory " + f.getClass().getName()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   316
                    + " does not implement the schema language specified by: " + schemaLanguage);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   317
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   318
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   319
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   320
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   321
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   322
     * Is specified schema supported by this {@code SchemaFactory}?
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   323
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   324
     * @param schemaLanguage Specifies the schema language which the returned {@code SchemaFactory} will understand.
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   325
     *    {@code schemaLanguage} must specify a <a href="#schemaLanguage">valid</a> schema language.
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   326
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   327
     * @return {@code true} if {@code SchemaFactory} supports {@code schemaLanguage}, else {@code false}.
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   328
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   329
     * @throws NullPointerException If {@code schemaLanguage} is {@code null}.
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   330
     * @throws IllegalArgumentException If {@code schemaLanguage.length() == 0}
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   331
     *   or {@code schemaLanguage} does not specify a <a href="#schemaLanguage">valid</a> schema language.
17264
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   332
     */
3aff554ad461 8005954: JAXP Plugability Layer should use java.util.ServiceLoader
dfuchs
parents: 12457
diff changeset
   333
    public abstract boolean isSchemaLanguageSupported(String schemaLanguage);
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   334
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   335
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   336
     * Look up the value of a feature flag.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   337
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   338
     * <p>The feature name is any fully-qualified URI.  It is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   339
     * possible for a {@link SchemaFactory} to recognize a feature name but
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   340
     * temporarily be unable to return its value.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   341
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   342
     * <p>Implementors are free (and encouraged) to invent their own features,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   343
     * using names built on their own URIs.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   344
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   345
     * @param name The feature name, which is a non-null fully-qualified URI.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   346
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   347
     * @return The current value of the feature (true or false).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   348
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   349
     * @throws SAXNotRecognizedException If the feature
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   350
     *   value can't be assigned or retrieved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   351
     * @throws SAXNotSupportedException When the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   352
     *   {@link SchemaFactory} recognizes the feature name but
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   353
     *   cannot determine its value at this time.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   354
     * @throws NullPointerException If {@code name} is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   355
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   356
     * @see #setFeature(String, boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   357
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   358
    public boolean getFeature(String name)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   359
        throws SAXNotRecognizedException, SAXNotSupportedException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   360
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   361
        if (name == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   362
                throw new NullPointerException("the name parameter is null");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   363
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   364
        throw new SAXNotRecognizedException(name);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   365
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   366
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   367
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   368
     * Set a feature for this {@code SchemaFactory},
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   369
     * {@link Schema}s created by this factory, and by extension,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   370
     * {@link Validator}s and {@link ValidatorHandler}s created by
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   371
     * those {@link Schema}s.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   372
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   373
     * <p>Implementors and developers should pay particular attention
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   374
     * to how the special {@link Schema} object returned by {@link
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   375
     * #newSchema()} is processed. In some cases, for example, when the
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   376
     * {@code SchemaFactory} and the class actually loading the
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   377
     * schema come from different implementations, it may not be possible
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   378
     * for {@code SchemaFactory} features to be inherited automatically.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   379
     * Developers should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   380
     * make sure that features, such as secure processing, are explicitly
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   381
     * set in both places.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   382
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   383
     * <p>The feature name is any fully-qualified URI. It is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   384
     * possible for a {@link SchemaFactory} to expose a feature value but
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   385
     * to be unable to change the current value.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   386
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   387
     * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   388
     * When the feature is:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   389
     * <ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   390
     *   <li>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   391
     *     {@code true}: the implementation will limit XML processing to conform to implementation limits.
24887
47b6d4800c64 8046443: A few typos in JAXP JavaDoc
joehw
parents: 20581
diff changeset
   392
     *     Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   393
     *     If XML processing is limited for security reasons, it will be reported via a call to the registered
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   394
     *    {@link ErrorHandler#fatalError(SAXParseException exception)}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   395
     *     See {@link #setErrorHandler(ErrorHandler errorHandler)}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   396
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   397
     *   <li>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   398
     *     {@code false}: the implementation will processing XML according to the XML specifications without
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   399
     *     regard to possible implementation limits.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   400
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   401
     * </ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   402
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   403
     * @param name The feature name, which is a non-null fully-qualified URI.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   404
     * @param value The requested value of the feature (true or false).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   405
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   406
     * @throws SAXNotRecognizedException If the feature
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   407
     *   value can't be assigned or retrieved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   408
     * @throws SAXNotSupportedException When the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   409
     *   {@link SchemaFactory} recognizes the feature name but
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   410
     *   cannot set the requested value.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   411
     * @throws NullPointerException If {@code name} is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   412
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   413
     * @see #getFeature(String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   414
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   415
    public void setFeature(String name, boolean value)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   416
        throws SAXNotRecognizedException, SAXNotSupportedException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   417
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   418
        if (name == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   419
                throw new NullPointerException("the name parameter is null");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   420
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   421
        throw new SAXNotRecognizedException(name);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   422
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   423
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   424
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   425
     * Set the value of a property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   426
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   427
     * <p>The property name is any fully-qualified URI. It is
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   428
     * possible for a {@link SchemaFactory} to recognize a property name but
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   429
     * to be unable to change the current value.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   430
     *
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   431
     * <p>
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   432
     * All implementations that implement JAXP 1.5 or newer are required to
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   433
     * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   434
     * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} properties.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   435
     *
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   436
     * <ul>
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   437
     *   <li>
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   438
     *      <p>Access to external DTDs in Schema files is restricted to the protocols
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   439
     *      specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   440
     *      If access is denied during the creation of new Schema due to the restriction
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   441
     *      of this property, {@link org.xml.sax.SAXException} will be thrown by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   442
     *      {@link #newSchema(Source)} or {@link #newSchema(File)}
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   443
     *      or {@link #newSchema(URL)} or {@link #newSchema(Source[])} method.
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   444
     *
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   445
     *      <p>Access to external DTDs in xml source files is restricted to the protocols
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   446
     *      specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   447
     *      If access is denied during validation due to the restriction
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   448
     *      of this property, {@link org.xml.sax.SAXException} will be thrown by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   449
     *      {@link javax.xml.validation.Validator#validate(Source)} or
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   450
     *      {@link javax.xml.validation.Validator#validate(Source, Result)} method.
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   451
     *
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   452
     *      <p>Access to external reference set by the schemaLocation attribute is
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   453
     *      restricted to the protocols specified by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   454
     *      {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property.
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   455
     *      If access is denied during validation due to the restriction of this property,
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   456
     *      {@link org.xml.sax.SAXException} will be thrown by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   457
     *      {@link javax.xml.validation.Validator#validate(Source)} or
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   458
     *      {@link javax.xml.validation.Validator#validate(Source, Result)} method.
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   459
     *
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   460
     *      <p>Access to external reference set by the Import
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   461
     *      and Include element is restricted to the protocols specified by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   462
     *      {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property.
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   463
     *      If access is denied during the creation of new Schema due to the restriction
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   464
     *      of this property, {@link org.xml.sax.SAXException} will be thrown by the
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   465
     *      {@link #newSchema(Source)} or {@link #newSchema(File)}
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   466
     *      or {@link #newSchema(URL)} or {@link #newSchema(Source[])} method.
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   467
     *   </li>
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 17264
diff changeset
   468
     * </ul>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   469
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   470
     * @param name The property name, which is a non-null fully-qualified URI.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   471
     * @param object The requested value for the property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   472
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   473
     * @throws SAXNotRecognizedException If the property
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   474
     *   value can't be assigned or retrieved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   475
     * @throws SAXNotSupportedException When the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   476
     *   {@link SchemaFactory} recognizes the property name but
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   477
     *   cannot set the requested value.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   478
     * @throws NullPointerException If {@code name} is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   479
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   480
    public void setProperty(String name, Object object)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   481
        throws SAXNotRecognizedException, SAXNotSupportedException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   482
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   483
        if (name == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   484
                throw new NullPointerException("the name parameter is null");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   485
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   486
        throw new SAXNotRecognizedException(name);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   487
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   488
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   489
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   490
     * Look up the value of a property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   491
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   492
     * <p>The property name is any fully-qualified URI.  It is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   493
     * possible for a {@link SchemaFactory} to recognize a property name but
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   494
     * temporarily be unable to return its value.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   495
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   496
     * <p>{@link SchemaFactory}s are not required to recognize any specific
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   497
     * property names.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   498
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   499
     * <p>Implementors are free (and encouraged) to invent their own properties,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   500
     * using names built on their own URIs.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   501
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   502
     * @param name The property name, which is a non-null fully-qualified URI.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   503
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   504
     * @return The current value of the property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   505
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   506
     * @throws SAXNotRecognizedException If the property
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   507
     *   value can't be assigned or retrieved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   508
     * @throws SAXNotSupportedException When the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   509
     *   XMLReader recognizes the property name but
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   510
     *   cannot determine its value at this time.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   511
     * @throws NullPointerException If {@code name} is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   512
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   513
     * @see #setProperty(String, Object)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   514
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   515
    public Object getProperty(String name)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   516
        throws SAXNotRecognizedException, SAXNotSupportedException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   517
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   518
        if (name == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   519
                throw new NullPointerException("the name parameter is null");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   520
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   521
        throw new SAXNotRecognizedException(name);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   522
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   523
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   524
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   525
     * Sets the {@link ErrorHandler} to receive errors encountered
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   526
     * during the {@code newSchema} method invocation.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   527
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   528
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   529
     * Error handler can be used to customize the error handling process
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   530
     * during schema parsing. When an {@link ErrorHandler} is set,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   531
     * errors found during the parsing of schemas will be first sent
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   532
     * to the {@link ErrorHandler}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   533
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   534
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   535
     * The error handler can abort the parsing of a schema immediately
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   536
     * by throwing {@link SAXException} from the handler. Or for example
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   537
     * it can print an error to the screen and try to continue the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   538
     * processing by returning normally from the {@link ErrorHandler}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   539
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   540
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   541
     * If any {@link Throwable} (or instances of its derived classes)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   542
     * is thrown from an {@link ErrorHandler},
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   543
     * the caller of the {@code newSchema} method will be thrown
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   544
     * the same {@link Throwable} object.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   545
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   546
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   547
     * {@link SchemaFactory} is not allowed to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   548
     * throw {@link SAXException} without first reporting it to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   549
     * {@link ErrorHandler}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   550
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   551
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   552
     * Applications can call this method even during a {@link Schema}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   553
     * is being parsed.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   554
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   555
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   556
     * When the {@link ErrorHandler} is null, the implementation will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   557
     * behave as if the following {@link ErrorHandler} is set:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   558
     * <pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   559
     * class DraconianErrorHandler implements {@link ErrorHandler} {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   560
     *     public void fatalError( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   561
     *         throw e;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   562
     *     }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   563
     *     public void error( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   564
     *         throw e;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   565
     *     }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   566
     *     public void warning( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   567
     *         // noop
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   568
     *     }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   569
     * }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   570
     * </pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   571
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   572
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   573
     * When a new {@link SchemaFactory} object is created, initially
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   574
     * this field is set to null. This field will <em>NOT</em> be
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   575
     * inherited to {@link Schema}s, {@link Validator}s, or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   576
     * {@link ValidatorHandler}s that are created from this {@link SchemaFactory}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   577
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   578
     * @param errorHandler A new error handler to be set.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   579
     *   This parameter can be {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   580
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   581
    public abstract void setErrorHandler(ErrorHandler errorHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   582
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   583
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   584
     * Gets the current {@link ErrorHandler} set to this {@link SchemaFactory}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   585
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   586
     * @return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   587
     *      This method returns the object that was last set through
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   588
     *      the {@link #setErrorHandler(ErrorHandler)} method, or null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   589
     *      if that method has never been called since this {@link SchemaFactory}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   590
     *      has created.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   591
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   592
     * @see #setErrorHandler(ErrorHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   593
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   594
    public abstract ErrorHandler getErrorHandler();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   595
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   596
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   597
     * Sets the {@link LSResourceResolver} to customize
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   598
     * resource resolution when parsing schemas.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   599
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   600
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   601
     * {@link SchemaFactory} uses a {@link LSResourceResolver}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   602
     * when it needs to locate external resources while parsing schemas,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   603
     * although exactly what constitutes "locating external resources" is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   604
     * up to each schema language. For example, for W3C XML Schema,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   605
     * this includes files {@code <include>}d or {@code <import>}ed,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   606
     * and DTD referenced from schema files, etc.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   607
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   608
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   609
     * Applications can call this method even during a {@link Schema}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   610
     * is being parsed.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   611
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   612
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   613
     * When the {@link LSResourceResolver} is null, the implementation will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   614
     * behave as if the following {@link LSResourceResolver} is set:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   615
     * <pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   616
     * class DumbDOMResourceResolver implements {@link LSResourceResolver} {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   617
     *     public {@link org.w3c.dom.ls.LSInput} resolveResource(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   618
     *         String publicId, String systemId, String baseURI) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   619
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   620
     *         return null; // always return null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   621
     *     }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   622
     * }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   623
     * </pre>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   624
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   625
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   626
     * If a {@link LSResourceResolver} throws a {@link RuntimeException}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   627
     *  (or instances of its derived classes),
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   628
     * then the {@link SchemaFactory} will abort the parsing and
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   629
     * the caller of the {@code newSchema} method will receive
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   630
     * the same {@link RuntimeException}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   631
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   632
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   633
     * When a new {@link SchemaFactory} object is created, initially
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   634
     * this field is set to null.  This field will <em>NOT</em> be
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   635
     * inherited to {@link Schema}s, {@link Validator}s, or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   636
     * {@link ValidatorHandler}s that are created from this {@link SchemaFactory}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   637
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   638
     * @param   resourceResolver
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   639
     *      A new resource resolver to be set. This parameter can be null.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   640
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   641
    public abstract void setResourceResolver(LSResourceResolver resourceResolver);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   642
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   643
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   644
     * Gets the current {@link LSResourceResolver} set to this {@link SchemaFactory}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   645
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   646
     * @return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   647
     *      This method returns the object that was last set through
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   648
     *      the {@link #setResourceResolver(LSResourceResolver)} method, or null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   649
     *      if that method has never been called since this {@link SchemaFactory}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   650
     *      has created.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   651
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   652
     * @see #setErrorHandler(ErrorHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   653
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   654
    public abstract LSResourceResolver getResourceResolver();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   655
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   656
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   657
     * Parses the specified source as a schema and returns it as a schema.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   658
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   659
     * <p>This is a convenience method for {@link #newSchema(Source[] schemas)}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   660
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   661
     * @param schema Source that represents a schema.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   662
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   663
     * @return New {@code Schema} from parsing {@code schema}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   664
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   665
     * @throws SAXException If a SAX error occurs during parsing.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   666
     * @throws NullPointerException if {@code schema} is null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   667
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   668
    public Schema newSchema(Source schema) throws SAXException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   669
        return newSchema(new Source[]{schema});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   670
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   671
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   672
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   673
     * Parses the specified {@code File} as a schema and returns it as a {@code Schema}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   674
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   675
     * <p>This is a convenience method for {@link #newSchema(Source schema)}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   676
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   677
     * @param schema File that represents a schema.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   678
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   679
     * @return New {@code Schema} from parsing {@code schema}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   680
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   681
     * @throws SAXException If a SAX error occurs during parsing.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   682
     * @throws NullPointerException if {@code schema} is null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   683
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   684
    public Schema newSchema(File schema) throws SAXException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   685
        return newSchema(new StreamSource(schema));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   686
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   687
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   688
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   689
     * Parses the specified {@code URL} as a schema and returns it as a {@code Schema}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   690
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   691
     * <p>This is a convenience method for {@link #newSchema(Source schema)}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   692
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   693
     * @param schema {@code URL} that represents a schema.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   694
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   695
     * @return New {@code Schema} from parsing {@code schema}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   696
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   697
     * @throws SAXException If a SAX error occurs during parsing.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   698
     * @throws NullPointerException if {@code schema} is null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   699
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   700
    public Schema newSchema(URL schema) throws SAXException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   701
        return newSchema(new StreamSource(schema.toExternalForm()));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   702
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   703
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   704
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   705
     * Parses the specified source(s) as a schema and returns it as a schema.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   706
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   707
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   708
     * The callee will read all the {@link Source}s and combine them into a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   709
     * single schema. The exact semantics of the combination depends on the schema
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   710
     * language that this {@link SchemaFactory} object is created for.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   711
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   712
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   713
     * When an {@link ErrorHandler} is set, the callee will report all the errors
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   714
     * found in sources to the handler. If the handler throws an exception, it will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   715
     * abort the schema compilation and the same exception will be thrown from
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   716
     * this method. Also, after an error is reported to a handler, the callee is allowed
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   717
     * to abort the further processing by throwing it. If an error handler is not set,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   718
     * the callee will throw the first error it finds in the sources.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   719
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   720
     * <h2>W3C XML Schema 1.0</h2>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   721
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   722
     * The resulting schema contains components from the specified sources.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   723
     * The same result would be achieved if all these sources were
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   724
     * imported, using appropriate values for schemaLocation and namespace,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   725
     * into a single schema document with a different targetNamespace
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   726
     * and no components of its own, if the import elements were given
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   727
     * in the same order as the sources.  Section 4.2.3 of the XML Schema
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   728
     * recommendation describes the options processors have in this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   729
     * regard.  While a processor should be consistent in its treatment of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   730
     * JAXP schema sources and XML Schema imports, the behaviour between
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   731
     * JAXP-compliant parsers may vary; in particular, parsers may choose
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   732
     * to ignore all but the first {@code <import>} for a given namespace,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   733
     * regardless of information provided in schemaLocation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   734
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   735
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   736
     * If the parsed set of schemas includes error(s) as
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   737
     * specified in the section 5.1 of the XML Schema spec, then
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   738
     * the error must be reported to the {@link ErrorHandler}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   739
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   740
     * <h2>RELAX NG</h2>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   741
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   742
     * <p>For RELAX NG, this method must throw {@link UnsupportedOperationException}
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   743
     * if {@code schemas.length!=1}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   744
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   745
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   746
     * @param schemas
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   747
     *      inputs to be parsed. {@link SchemaFactory} is required
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   748
     *      to recognize {@link javax.xml.transform.sax.SAXSource},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   749
     *      {@link StreamSource},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   750
     *      {@link javax.xml.transform.stax.StAXSource},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   751
     *      and {@link javax.xml.transform.dom.DOMSource}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   752
     *      Input schemas must be XML documents or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   753
     *      XML elements and must not be null. For backwards compatibility,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   754
     *      the results of passing anything other than
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   755
     *      a document or element are implementation-dependent.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   756
     *      Implementations must either recognize and process the input
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   757
     *      or thrown an IllegalArgumentException.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   758
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   759
     * @return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   760
     *      Always return a non-null valid {@link Schema} object.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   761
     *      Note that when an error has been reported, there is no
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   762
     *      guarantee that the returned {@link Schema} object is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   763
     *      meaningful.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   764
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   765
     * @throws SAXException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   766
     *      If an error is found during processing the specified inputs.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   767
     *      When an {@link ErrorHandler} is set, errors are reported to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   768
     *      there first. See {@link #setErrorHandler(ErrorHandler)}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   769
     * @throws NullPointerException
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   770
     *      If the {@code schemas} parameter itself is null or
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   771
     *      any item in the array is null.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   772
     * @throws IllegalArgumentException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   773
     *      If any item in the array is not recognized by this method.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   774
     * @throws UnsupportedOperationException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   775
     *      If the schema language doesn't support this operation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   776
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   777
    public abstract Schema newSchema(Source[] schemas) throws SAXException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   778
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   779
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   780
     * Creates a special {@link Schema} object.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   781
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   782
     * <p>The exact semantics of the returned {@link Schema} object
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   783
     * depend on the schema language for which this {@link SchemaFactory}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   784
     * is created.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   785
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   786
     * <p>Also, implementations are allowed to use implementation-specific
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   787
     * property/feature to alter the semantics of this method.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   788
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   789
     * <p>Implementors and developers should pay particular attention
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   790
     * to how the features set on this {@link SchemaFactory} are
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   791
     * processed by this special {@link Schema}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   792
     * In some cases, for example, when the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   793
     * {@link SchemaFactory} and the class actually loading the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   794
     * schema come from different implementations, it may not be possible
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   795
     * for {@link SchemaFactory} features to be inherited automatically.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   796
     * Developers should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   797
     * make sure that features, such as secure processing, are explicitly
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 29419
diff changeset
   798
     * set in both places.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   799
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   800
     * <h2>W3C XML Schema 1.0</h2>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   801
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   802
     * For XML Schema, this method creates a {@link Schema} object that
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   803
     * performs validation by using location hints specified in documents.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   804
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   805
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   806
     * The returned {@link Schema} object assumes that if documents
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   807
     * refer to the same URL in the schema location hints,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   808
     * they will always resolve to the same schema document. This
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   809
     * asusmption allows implementations to reuse parsed results of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   810
     * schema documents so that multiple validations against the same
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   811
     * schema will run faster.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   812
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   813
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   814
     * Note that the use of schema location hints introduces a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   815
     * vulnerability to denial-of-service attacks.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   816
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   817
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   818
     * <h2>RELAX NG</h2>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   819
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   820
     * RELAX NG does not support this operation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   821
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   822
     * @return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   823
     *      Always return non-null valid {@link Schema} object.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   824
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   825
     * @throws UnsupportedOperationException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   826
     *      If this operation is not supported by the callee.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   827
     * @throws SAXException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   828
     *      If this operation is supported but failed for some reason.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   829
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   830
    public abstract Schema newSchema() throws SAXException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   831
}