jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java
author chegar
Sun, 17 Aug 2014 15:51:56 +0100
changeset 25868 686eef1e7a79
parent 12457 jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java@c348e06f0e82
child 26516 8e6a45c22cea
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
// CatalogReader.java - An interface for reading catalog files
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Copyright 2001-2004 The Apache Software Foundation or its licensors,
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * as applicable.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *      http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
package com.sun.org.apache.xml.internal.resolver.readers;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import java.net.MalformedURLException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.xml.internal.resolver.CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import java.io.InputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import com.sun.org.apache.xml.internal.resolver.Catalog;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * The CatalogReader interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * <p>The Catalog class requires that classes implement this interface
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * in order to be used to read catalogs. Examples of CatalogReaders
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * include the TextCatalogReader, the SAXCatalogReader, and the
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * DOMCatalogReader.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * @see Catalog
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * @author Norman Walsh
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
public interface CatalogReader {
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
     * Read a catalog from a file.
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
     * <p>This class reads a catalog from a URL.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
     * @param catalog The catalog for which this reader is called.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
     * @param fileUrl The URL of a document to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
     * @throws MalformedURLException if the specified URL cannot be
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
     * turned into a URL object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     * @throws IOException if the URL cannot be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     * @throws UnknownCatalogFormatException if the catalog format is
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     * not recognized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     * @throws UnparseableCatalogException if the catalog cannot be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * (For example, if it is supposed to be XML and isn't well-formed.)
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    public void readCatalog(Catalog catalog, String fileUrl)
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
      throws MalformedURLException, IOException, CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * Read a catalog from an input stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * <p>This class reads a catalog from an input stream.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * @param catalog The catalog for which this reader is called.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * @param is The input stream that is to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * @throws IOException if the URL cannot be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * @throws UnknownCatalogFormatException if the catalog format is
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     * not recognized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * @throws UnparseableCatalogException if the catalog cannot be parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     * (For example, if it is supposed to be XML and isn't well-formed.)
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
    public void readCatalog(Catalog catalog, InputStream is)
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
        throws IOException, CatalogException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
}