1 /*
2 * Copyright (c) 2000, 2005, 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
23 * questions.
24 */
25
26 // SAX entity resolver.
27 // http://www.saxproject.org
28 // No warranty; no copyright -- use this as you will.
29 // $Id: EntityResolver.java,v 1.2 2004/11/03 22:44:52 jsuttor Exp $
30
31 package org.xml.sax;
32
33 import java.io.IOException;
34
35
36 /**
37 * Basic interface for resolving entities.
38 *
39 * <blockquote>
40 * <em>This module, both source code and documentation, is in the
41 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
42 * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
43 * for further information.
44 * </blockquote>
45 *
46 * <p>If a SAX application needs to implement customized handling
47 * for external entities, it must implement this interface and
48 * register an instance with the SAX driver using the
49 * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver}
50 * method.</p>
51 *
52 * <p>The XML reader will then allow the application to intercept any
53 * external entities (including the external DTD subset and external
54 * parameter entities, if any) before including them.</p>
55 *
56 * <p>Many SAX applications will not need to implement this interface,
57 * but it will be especially useful for applications that build
58 * XML documents from databases or other specialised input sources,
59 * or for applications that use URI types other than URLs.</p>
60 *
61 * <p>The following resolver would provide the application
62 * with a special character stream for the entity with the system
63 * identifier "http://www.myhost.com/today":</p>
64 *
|
1 /*
2 * Copyright (c) 2000, 2019, 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
23 * questions.
24 */
25
26 package org.xml.sax;
27
28 import java.io.IOException;
29
30
31 /**
32 * Basic interface for resolving entities.
33 *
34 * <p>If a SAX application needs to implement customized handling
35 * for external entities, it must implement this interface and
36 * register an instance with the SAX driver using the
37 * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver}
38 * method.</p>
39 *
40 * <p>The XML reader will then allow the application to intercept any
41 * external entities (including the external DTD subset and external
42 * parameter entities, if any) before including them.</p>
43 *
44 * <p>Many SAX applications will not need to implement this interface,
45 * but it will be especially useful for applications that build
46 * XML documents from databases or other specialised input sources,
47 * or for applications that use URI types other than URLs.</p>
48 *
49 * <p>The following resolver would provide the application
50 * with a special character stream for the entity with the system
51 * identifier "http://www.myhost.com/today":</p>
52 *
|