jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java
author joehw
Fri, 05 Sep 2014 14:04:22 -0700
changeset 26516 8e6a45c22cea
parent 25868 686eef1e7a79
permissions -rw-r--r--
8056202: Xerces Update: Catalog Resolver Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
26516
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     2
 * Licensed to the Apache Software Foundation (ASF) under one or more
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     3
 * contributor license agreements.  See the NOTICE file distributed with
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     4
 * this work for additional information regarding copyright ownership.
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     5
 * The ASF licenses this file to You under the Apache License, Version 2.0
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     6
 * (the "License"); you may not use this file except in compliance with
8e6a45c22cea 8056202: Xerces Update: Catalog Resolver
joehw
parents: 25868
diff changeset
     7
 * the License.  You may obtain a copy of the License at
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *      http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
package com.sun.org.apache.xml.internal.resolver.readers;
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
import java.net.MalformedURLException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
import com.sun.org.apache.xml.internal.resolver.CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
import java.io.InputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import com.sun.org.apache.xml.internal.resolver.Catalog;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * The CatalogReader interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 * <p>The Catalog class requires that classes implement this interface
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * in order to be used to read catalogs. Examples of CatalogReaders
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 * include the TextCatalogReader, the SAXCatalogReader, and the
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * DOMCatalogReader.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * @see Catalog
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * @author Norman Walsh
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
public interface CatalogReader {
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
     * Read a catalog from a file.
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
     * <p>This class reads a catalog from a URL.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
     * @param catalog The catalog for which this reader is called.
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
     * @param fileUrl The URL of a document to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
     * @throws MalformedURLException if the specified URL cannot be
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
     * turned into a URL object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
     * @throws IOException if the URL cannot be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
     * @throws UnknownCatalogFormatException if the catalog format is
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
     * not recognized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
     * @throws UnparseableCatalogException if the catalog cannot be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
     * (For example, if it is supposed to be XML and isn't well-formed.)
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    public void readCatalog(Catalog catalog, String fileUrl)
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
      throws MalformedURLException, IOException, CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * Read a catalog from an input stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * <p>This class reads a catalog from an input stream.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     * @param catalog The catalog for which this reader is called.
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * @param is The input stream that is to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * @throws IOException if the URL cannot be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * @throws UnknownCatalogFormatException if the catalog format is
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * not recognized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     * @throws UnparseableCatalogException if the catalog cannot be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * (For example, if it is supposed to be XML and isn't well-formed.)
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    public void readCatalog(Catalog catalog, InputStream is)
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
        throws IOException, CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
}