author | malenkov |
Tue, 29 Oct 2013 17:01:06 +0400 | |
changeset 21278 | ef8a3a2a72f2 |
parent 14908 | 1d01112e9ce5 |
child 23010 | 6dadb192ad81 |
permissions | -rw-r--r-- |
14908
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
1 |
/* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
2 |
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
4 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
10 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
15 |
* accompanied this code). |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
16 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
20 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
23 |
* questions. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
24 |
*/ |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
25 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
26 |
// SAX entity resolver. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
27 |
// http://www.saxproject.org |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
28 |
// No warranty; no copyright -- use this as you will. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
29 |
// $Id: EntityResolver.java,v 1.2 2004/11/03 22:44:52 jsuttor Exp $ |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
30 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
31 |
package jdk.internal.org.xml.sax; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
32 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
33 |
import java.io.IOException; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
34 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
35 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
36 |
/** |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
37 |
* Basic interface for resolving entities. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
38 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
39 |
* <blockquote> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
40 |
* <em>This module, both source code and documentation, is in the |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
41 |
* Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
42 |
* See <a href='http://www.saxproject.org'>http://www.saxproject.org</a> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
43 |
* for further information. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
44 |
* </blockquote> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
45 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
46 |
* <p>If a SAX application needs to implement customized handling |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
47 |
* for external entities, it must implement this interface and |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
48 |
* register an instance with the SAX driver using the |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
49 |
* {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver} |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
50 |
* method.</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
51 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
52 |
* <p>The XML reader will then allow the application to intercept any |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
53 |
* external entities (including the external DTD subset and external |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
54 |
* parameter entities, if any) before including them.</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
55 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
56 |
* <p>Many SAX applications will not need to implement this interface, |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
57 |
* but it will be especially useful for applications that build |
21278 | 58 |
* XML documents from databases or other specialized input sources, |
14908
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
59 |
* or for applications that use URI types other than URLs.</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
60 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
61 |
* <p>The following resolver would provide the application |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
62 |
* with a special character stream for the entity with the system |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
63 |
* identifier "http://www.myhost.com/today":</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
64 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
65 |
* <pre> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
66 |
* import org.xml.sax.EntityResolver; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
67 |
* import org.xml.sax.InputSource; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
68 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
69 |
* public class MyResolver implements EntityResolver { |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
70 |
* public InputSource resolveEntity (String publicId, String systemId) |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
71 |
* { |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
72 |
* if (systemId.equals("http://www.myhost.com/today")) { |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
73 |
* // return a special input source |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
74 |
* MyReader reader = new MyReader(); |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
75 |
* return new InputSource(reader); |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
76 |
* } else { |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
77 |
* // use the default behaviour |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
78 |
* return null; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
79 |
* } |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
80 |
* } |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
81 |
* } |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
82 |
* </pre> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
83 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
84 |
* <p>The application can also use this interface to redirect system |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
85 |
* identifiers to local URIs or to look up replacements in a catalog |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
86 |
* (possibly by using the public identifier).</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
87 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
88 |
* @since SAX 1.0 |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
89 |
* @author David Megginson |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
90 |
* @see org.xml.sax.XMLReader#setEntityResolver |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
91 |
* @see org.xml.sax.InputSource |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
92 |
*/ |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
93 |
public interface EntityResolver { |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
94 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
95 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
96 |
/** |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
97 |
* Allow the application to resolve external entities. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
98 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
99 |
* <p>The parser will call this method before opening any external |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
100 |
* entity except the top-level document entity. Such entities include |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
101 |
* the external DTD subset and external parameter entities referenced |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
102 |
* within the DTD (in either case, only if the parser reads external |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
103 |
* parameter entities), and external general entities referenced |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
104 |
* within the document element (if the parser reads external general |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
105 |
* entities). The application may request that the parser locate |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
106 |
* the entity itself, that it use an alternative URI, or that it |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
107 |
* use data provided by the application (as a character or byte |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
108 |
* input stream).</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
109 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
110 |
* <p>Application writers can use this method to redirect external |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
111 |
* system identifiers to secure and/or local URIs, to look up |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
112 |
* public identifiers in a catalogue, or to read an entity from a |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
113 |
* database or other input source (including, for example, a dialog |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
114 |
* box). Neither XML nor SAX specifies a preferred policy for using |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
115 |
* public or system IDs to resolve resources. However, SAX specifies |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
116 |
* how to interpret any InputSource returned by this method, and that |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
117 |
* if none is returned, then the system ID will be dereferenced as |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
118 |
* a URL. </p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
119 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
120 |
* <p>If the system identifier is a URL, the SAX parser must |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
121 |
* resolve it fully before reporting it to the application.</p> |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
122 |
* |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
123 |
* @param publicId The public identifier of the external entity |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
124 |
* being referenced, or null if none was supplied. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
125 |
* @param systemId The system identifier of the external entity |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
126 |
* being referenced. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
127 |
* @return An InputSource object describing the new input source, |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
128 |
* or null to request that the parser open a regular |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
129 |
* URI connection to the system identifier. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
130 |
* @exception org.xml.sax.SAXException Any SAX exception, possibly |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
131 |
* wrapping another exception. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
132 |
* @exception java.io.IOException A Java-specific IO exception, |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
133 |
* possibly the result of creating a new InputStream |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
134 |
* or Reader for the InputSource. |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
135 |
* @see org.xml.sax.InputSource |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
136 |
*/ |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
137 |
public abstract InputSource resolveEntity (String publicId, |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
138 |
String systemId) |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
139 |
throws SAXException, IOException; |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
140 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
141 |
} |
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
142 |
|
1d01112e9ce5
8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff
changeset
|
143 |
// end of EntityResolver.java |