KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > xml > EntityResolver


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.xml;
9
10 import org.apache.avalon.framework.component.Component;
11 import org.xml.sax.InputSource JavaDoc;
12 import org.xml.sax.SAXException JavaDoc;
13
14 import java.io.IOException JavaDoc;
15
16 /**
17  * A component that uses catalogs for resolving Entities.
18  *
19  * @author <a HREF="mailto:dims@yahoo.com">Davanum Srinivas</a>
20  * @version CVS $Revision: 1.1 $ $Date: 2001/12/27 15:00:32 $
21  */

22 public interface EntityResolver
23 extends Component, org.xml.sax.EntityResolver JavaDoc {
24
25     String JavaDoc ROLE = "org.apache.avalon.excalibur.xml.EntityResolver";
26
27     /**
28      * Allow the application to resolve external entities.
29      *
30      * <p>The Parser will call this method before opening any external
31      * entity except the top-level document entity (including the
32      * external DTD subset, external entities referenced within the
33      * DTD, and external entities referenced within the document
34      * element): the application may request that the parser resolve
35      * the entity itself, that it use an alternative URI, or that it
36      * use an entirely different input source.</p>
37      *
38      * <p>Application writers can use this method to redirect external
39      * system identifiers to secure and/or local URIs, to look up
40      * public identifiers in a catalogue, or to read an entity from a
41      * database or other input source (including, for example, a dialog
42      * box).</p>
43      *
44      * <p>If the system identifier is a URL, the SAX parser must
45      * resolve it fully before reporting it to the application.</p>
46      *
47      * @param publicId The public identifier of the external entity
48      * being referenced, or null if none was supplied.
49      * @param systemId The system identifier of the external entity
50      * being referenced.
51      * @return An InputSource object describing the new input source,
52      * or null to request that the parser open a regular
53      * URI connection to the system identifier.
54      * @exception org.xml.sax.SAXException Any SAX exception, possibly
55      * wrapping another exception.
56      * @exception java.io.IOException A Java-specific IO exception,
57      * possibly the result of creating a new InputStream
58      * or Reader for the InputSource.
59      * @see org.xml.sax.InputSource
60      */

61     InputSource JavaDoc resolveEntity(String JavaDoc publicId,
62                               String JavaDoc systemId)
63     throws SAXException JavaDoc, IOException JavaDoc;
64 }
65
Popular Tags