01 package javax.xml.stream;
02
03 /**
04 * This interface is used to resolve resources during an XML parse. If an application wishes to
05 * perform custom entity resolution it must register an instance of this interface with
06 * the XMLInputFactory using the setXMLResolver method.
07 *
08 * @version 1.0
09 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
10 * @since 1.6
11 */
12 public interface XMLResolver {
13
14 /**
15 * Retrieves a resource. This resource can be of the following three return types:
16 * (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader.
17 * If this method returns null the processor will attempt to resolve the entity using its
18 * default mechanism.
19 *
20 * @param publicID The public identifier of the external entity being referenced, or null if none was supplied.
21 * @param systemID The system identifier of the external entity being referenced.
22 * @param baseURI Absolute base URI associated with systemId.
23 * @param namespace The namespace of the entity to resolve.
24 * @return The resource requested or null.
25 * @throws XMLStreamException if there was a failure attempting to resolve the resource.
26 */
27 public Object resolveEntity(String publicID, String systemID,
28 String baseURI, String namespace) throws XMLStreamException;
29 }
|