286N/A/*
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation. Oracle designates this
286N/A * particular file as subject to the "Classpath" exception as provided
286N/A * by Oracle in the LICENSE file that accompanied this code.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/A
286N/A/*
286N/A * This file is available under and governed by the GNU General Public
286N/A * License version 2 only, as published by the Free Software Foundation.
286N/A * However, the following notice accompanied the original version of this
286N/A * file and, per its terms, should not be removed:
286N/A *
286N/A * Copyright (c) 2004 World Wide Web Consortium,
286N/A *
286N/A * (Massachusetts Institute of Technology, European Research Consortium for
286N/A * Informatics and Mathematics, Keio University). All Rights Reserved. This
286N/A * work is distributed under the W3C(r) Software License [1] in the hope that
286N/A * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
286N/A * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
286N/A *
286N/A * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
286N/A */
286N/A
286N/Apackage org.w3c.dom.ls;
286N/A
286N/A/**
286N/A * <code>LSResourceResolver</code> provides a way for applications to
286N/A * redirect references to external resources.
286N/A * <p> Applications needing to implement custom handling for external
286N/A * resources can implement this interface and register their implementation
286N/A * by setting the "resource-resolver" parameter of
286N/A * <code>DOMConfiguration</code> objects attached to <code>LSParser</code>
286N/A * and <code>LSSerializer</code>. It can also be register on
286N/A * <code>DOMConfiguration</code> objects attached to <code>Document</code>
286N/A * if the "LS" feature is supported.
286N/A * <p> The <code>LSParser</code> will then allow the application to intercept
286N/A * any external entities, including the external DTD subset and external
286N/A * parameter entities, before including them. The top-level document entity
286N/A * is never passed to the <code>resolveResource</code> method.
286N/A * <p> Many DOM applications will not need to implement this interface, but it
286N/A * will be especially useful for applications that build XML documents from
286N/A * databases or other specialized input sources, or for applications that
286N/A * use URNs.
286N/A * <p ><b>Note:</b> <code>LSResourceResolver</code> is based on the SAX2 [<a href='http://www.saxproject.org/'>SAX</a>] <code>EntityResolver</code>
286N/A * interface.
286N/A * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
286N/Aand Save Specification</a>.
286N/A */
286N/Apublic interface LSResourceResolver {
286N/A /**
286N/A * Allow the application to resolve external resources.
286N/A * <br> The <code>LSParser</code> will call this method before opening any
286N/A * external resource, including the external DTD subset, external
286N/A * entities referenced within the DTD, and external entities referenced
286N/A * within the document element (however, the top-level document entity
286N/A * is not passed to this method). The application may then request that
286N/A * the <code>LSParser</code> resolve the external resource itself, that
286N/A * it use an alternative URI, or that it use an entirely different input
286N/A * source.
286N/A * <br> Application writers can use this method to redirect external
286N/A * system identifiers to secure and/or local URI, to look up public
286N/A * identifiers in a catalogue, or to read an entity from a database or
286N/A * other input source (including, for example, a dialog box).
286N/A * @param type The type of the resource being resolved. For XML [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] resources
286N/A * (i.e. entities), applications must use the value
286N/A * <code>"http://www.w3.org/TR/REC-xml"</code>. For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
286N/A * , applications must use the value
286N/A * <code>"http://www.w3.org/2001/XMLSchema"</code>. Other types of
286N/A * resources are outside the scope of this specification and therefore
286N/A * should recommend an absolute URI in order to use this method.
286N/A * @param namespaceURI The namespace of the resource being resolved,
286N/A * e.g. the target namespace of the XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
286N/A * when resolving XML Schema resources.
286N/A * @param publicId The public identifier of the external entity being
286N/A * referenced, or <code>null</code> if no public identifier was
286N/A * supplied or if the resource is not an entity.
286N/A * @param systemId The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], of the
286N/A * external resource being referenced, or <code>null</code> if no
286N/A * system identifier was supplied.
286N/A * @param baseURI The absolute base URI of the resource being parsed, or
286N/A * <code>null</code> if there is no base URI.
286N/A * @return A <code>LSInput</code> object describing the new input
286N/A * source, or <code>null</code> to request that the parser open a
286N/A * regular URI connection to the resource.
286N/A */
286N/A public LSInput resolveResource(String type,
286N/A String namespaceURI,
286N/A String publicId,
286N/A String systemId,
286N/A String baseURI);
286N/A
286N/A}