blob: 3e1e3efdd6e33deb6e176f6085dbab80c04a32a9 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.components.resolver;
import org.apache.avalon.framework.component.Component;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import java.io.IOException;
/**
* A component that uses catalogs for resolving entities.
* @deprecated Use the Avalon Excalibur EntityResolver instead
*
* @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
* @author <a href="mailto:crossley@apache.org">David Crossley</a>
* @version CVS $Id$
*/
public interface Resolver extends Component, EntityResolver {
String ROLE = "org.apache.cocoon.components.resolver.Resolver";
/**
* Allow the application to resolve external entities.
*
* <p>The Parser will call this method before opening any external
* entity except the top-level document entity (including the
* external DTD subset, external entities referenced within the
* DTD, and external entities referenced within the document
* element): the application may request that the parser resolve
* the entity itself, that it use an alternative URI, or that it
* use an entirely different input source.</p>
*
* <p>Application writers can use this method to redirect external
* system identifiers to secure and/or local URIs, to look up
* public identifiers in a catalogue, or to read an entity from a
* database or other input source (including, for example, a dialog
* box).</p>
*
* <p>If the system identifier is a URL, the SAX parser must
* resolve it fully before reporting it to the application.</p>
*
* @param publicId The public identifier of the external entity
* being referenced, or null if none was supplied.
* @param systemId The system identifier of the external entity
* being referenced.
* @return An InputSource object describing the new input source,
* or null to request that the parser open a regular
* URI connection to the system identifier.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
* @exception java.io.IOException A Java-specific IO exception,
* possibly the result of creating a new InputStream
* or Reader for the InputSource.
* @see org.xml.sax.InputSource
*/
InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException;
}