KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > resolver > Resolver


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.resolver;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.xml.sax.EntityResolver JavaDoc;
20 import org.xml.sax.InputSource JavaDoc;
21 import org.xml.sax.SAXException JavaDoc;
22 import java.io.IOException JavaDoc;
23
24 /**
25  * A component that uses catalogs for resolving entities.
26  * @deprecated Use the Avalon Excalibur EntityResolver instead
27  *
28  * @author <a HREF="mailto:dims@yahoo.com">Davanum Srinivas</a>
29  * @author <a HREF="mailto:crossley@apache.org">David Crossley</a>
30  * @version CVS $Id: Resolver.java 30932 2004-07-29 17:35:38Z vgritsenko $
31  */

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

70     InputSource JavaDoc resolveEntity(String JavaDoc publicId, String JavaDoc systemId)
71         throws SAXException JavaDoc, IOException JavaDoc;
72 }
73
Popular Tags