1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.xs;
  23 
  24 import org.w3c.dom.DOMConfiguration;
  25 import org.w3c.dom.ls.LSInput;
  26 
  27 /**
  28  * An interface that provides a method to load XML Schema documents. This
  29  * interface uses the DOM Level 3 Core and Load and Save interfaces.
  30  */
  31 public interface XSLoader {
  32     /**
  33      *  The configuration of a document. It maintains a table of recognized
  34      * parameters. Using the configuration, it is possible to change the
  35      * behavior of the load methods. The configuration may support the
  36      * setting of and the retrieval of the following non-boolean parameters
  37      * defined on the <code>DOMConfiguration</code> interface:
  38      * <code>error-handler</code> (<code>DOMErrorHandler</code>) and
  39      * <code>resource-resolver</code> (<code>LSResourceResolver</code>).
  40      * <br> The following list of boolean parameters is defined:
  41      * <dl>
  42      * <dt>
  43      * <code>"validate"</code></dt>
  44      * <dd>
  45      * <dl>
  46      * <dt><code>true</code></dt>
  47      * <dd>[required] (default) Validate an XML
  48      * Schema during loading. If validation errors are found, the error
  49      * handler is notified. </dd>
  50      * <dt><code>false</code></dt>
  51      * <dd>[optional] Do not
  52      * report errors during the loading of an XML Schema document. </dd>
  53      * </dl></dd>
  54      * </dl>
  55      */
  56     public DOMConfiguration getConfig();
  57 
  58     /**
  59      * Parses the content of XML Schema documents specified as the list of URI
  60      * references. If the URI contains a fragment identifier, the behavior
  61      * is not defined by this specification.
  62      * @param uriList The list of URI locations.
  63      * @return An XSModel representing the schema documents.
  64      */
  65     public XSModel loadURIList(StringList uriList);
  66 
  67     /**
  68      *  Parses the content of XML Schema documents specified as a list of
  69      * <code>LSInput</code>s.
  70      * @param is  The list of <code>LSInput</code>s from which the XML
  71      *   Schema documents are to be read.
  72      * @return An XSModel representing the schema documents.
  73      */
  74     public XSModel loadInputList(LSInputList is);
  75 
  76     /**
  77      * Parse an XML Schema document from a location identified by a URI
  78      * reference. If the URI contains a fragment identifier, the behavior is
  79      * not defined by this specification.
  80      * @param uri The location of the XML Schema document to be read.
  81      * @return An XSModel representing this schema.
  82      */
  83     public XSModel loadURI(String uri);
  84 
  85     /**
  86      *  Parse an XML Schema document from a resource identified by a
  87      * <code>LSInput</code> .
  88      * @param is  The <code>LSInput</code> from which the source
  89      *   document is to be read.
  90      * @return An XSModel representing this schema.
  91      */
  92     public XSModel load(LSInput is);
  93 
  94 }