1 /*
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
25
26 package javax.xml.catalog;
27
28 import java.util.stream.Stream;
29
30 /**
31 * The Catalog class represents an entity Catalog as defined by
32 * <a
33 * href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">
34 * XML Catalogs, OASIS Standard V1.1, 7 October 2005</a>.
35 * <p>
36 * A catalog is an XML file that contains a root {@code catalog} entry with a list
37 * of catalog entries. The entries can also be grouped with a {@code group} entry.
38 * The catalog and group entries may specify {@code prefer} and {@code xml:base}
39 * attributes that set preference of public or system type of entries and base URI
40 * to resolve relative URIs.
41 *
42 * <p>
43 * A catalog can be used in two situations:
44 * <ul>
45 * <li>Locate the replacement text for an external entity;
46 * </li>
47 * <li>Locate an alternate URI reference for a resource.
48 * </li>
49 * </ul>
50 * <p>
51 * For case 1, the standard defines 6 External Identifier Entries:<br>
52 * {@code public, system, rewriteSystem, systemSuffix, delegatePublic, and
53 * delegateSystem}.
54 * <p>
55 * While for case 2, it defines 4 URI Entries:<br>
56 * {@code uri, rewriteURI, uriSuffix and delegateURI}.
57 * <p>
58 * In addition to the above entry types, a catalog may define nextCatalog
59 * entries to add additional catalog entry files.
60 * <p>
61 *
62 * @since 9
63 */
64 public interface Catalog {
65
66 /**
67 * Attempts to find a matching entry in the catalog by systemId.
|
1 /*
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
25
26 package javax.xml.catalog;
27
28 import java.util.stream.Stream;
29
30 /**
31 * The Catalog class represents an entity Catalog as defined by
32 * <a
33 * href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">
34 * XML Catalogs, OASIS Standard V1.1, 7 October 2005</a>.
35 * <p>
36 * A catalog is an XML file that contains a root {@code catalog} entry with a list
37 * of catalog entries. The entries can also be grouped with a {@code group} entry.
38 * The catalog and group entries may specify {@code prefer} and {@code xml:base}
39 * attributes that set preference of public or system type of entries and base URI
40 * to resolve relative URIs.
41 *
42 * <p>
43 * A catalog can be used in two situations:
44 * <ul>
45 * <li>Locate the external resources with a public or system identifier;
46 * </li>
47 * <li>Locate an alternate URI reference with an URI.
48 * </li>
49 * </ul>
50 * <p>
51 * For case 1, the standard defines 6 External Identifier Entries:<br>
52 * {@code public, system, rewriteSystem, systemSuffix, delegatePublic, and
53 * delegateSystem}.
54 * <p>
55 * While for case 2, it defines 4 URI Entries:<br>
56 * {@code uri, rewriteURI, uriSuffix and delegateURI}.
57 * <p>
58 * In addition to the above entry types, a catalog may define nextCatalog
59 * entries to add additional catalog entry files.
60 * <p>
61 *
62 * @since 9
63 */
64 public interface Catalog {
65
66 /**
67 * Attempts to find a matching entry in the catalog by systemId.
|