View Javadoc
1   /*
2    * reserved comment block
3    * DO NOT REMOVE OR ALTER!
4    */
5   /*
6    * Copyright 2001, 2002,2004 The Apache Software Foundation.
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   *      http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  
21  package com.sun.org.apache.xerces.internal.xni.parser;
22  
23  import java.io.IOException;
24  
25  import com.sun.org.apache.xerces.internal.xni.XNIException;
26  import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
27  
28  /**
29   * This interface is used to resolve external parsed entities. The
30   * application can register an object that implements this interface
31   * with the parser configuration in order to intercept entities and
32   * resolve them explicitly. If the registered entity resolver cannot
33   * resolve the entity, it should return <code>null</code> so that the
34   * parser will try to resolve the entity using a default mechanism.
35   *
36   * @see XMLParserConfiguration
37   *
38   * @author Andy Clark, IBM
39   *
40   */
41  public interface XMLEntityResolver {
42  
43      //
44      // XMLEntityResolver methods
45      //
46  
47      /**
48       * Resolves an external parsed entity. If the entity cannot be
49       * resolved, this method should return null.
50       *
51       * @param resourceIdentifier location of the XML resource to resolve
52       *
53       * @throws XNIException Thrown on general error.
54       * @throws IOException  Thrown if resolved entity stream cannot be
55       *                      opened or some other i/o error occurs.
56       * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier
57       */
58      public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
59          throws XNIException, IOException;
60  
61  } // interface XMLEntityResolver