01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.xni.parser;
19:
20: import java.io.IOException;
21:
22: import org.apache.xerces.xni.XNIException;
23: import org.apache.xerces.xni.XMLResourceIdentifier;
24:
25: /**
26: * This interface is used to resolve external parsed entities. The
27: * application can register an object that implements this interface
28: * with the parser configuration in order to intercept entities and
29: * resolve them explicitly. If the registered entity resolver cannot
30: * resolve the entity, it should return <code>null</code> so that the
31: * parser will try to resolve the entity using a default mechanism.
32: *
33: * @see XMLParserConfiguration
34: *
35: * @author Andy Clark, IBM
36: *
37: * @version $Id: XMLEntityResolver.java 447244 2006-09-18 05:20:40Z mrglavas $
38: */
39: public interface XMLEntityResolver {
40:
41: //
42: // XMLEntityResolver methods
43: //
44:
45: /**
46: * Resolves an external parsed entity. If the entity cannot be
47: * resolved, this method should return null.
48: *
49: * @param resourceIdentifier location of the XML resource to resolve
50: *
51: * @throws XNIException Thrown on general error.
52: * @throws IOException Thrown if resolved entity stream cannot be
53: * opened or some other i/o error occurs.
54: * @see org.apache.xerces.xni.XMLResourceIdentifier
55: */
56: public XMLInputSource resolveEntity(
57: XMLResourceIdentifier resourceIdentifier)
58: throws XNIException, IOException;
59:
60: } // interface XMLEntityResolver
|