XMLResolver.java revision 286
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 * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
286N/A */
286N/A
286N/Apackage javax.xml.stream;
286N/A
286N/A/**
286N/A * This interface is used to resolve resources during an XML parse. If an application wishes to
286N/A * perform custom entity resolution it must register an instance of this interface with
286N/A * the XMLInputFactory using the setXMLResolver method.
286N/A *
286N/A * @version 1.0
286N/A * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
286N/A * @since 1.6
286N/A */
286N/Apublic interface XMLResolver {
286N/A
286N/A /**
286N/A * Retrieves a resource. This resource can be of the following three return types:
286N/A * (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader.
286N/A * If this method returns null the processor will attempt to resolve the entity using its
286N/A * default mechanism.
286N/A *
286N/A * @param publicID The public identifier of the external entity being referenced, or null if none was supplied.
286N/A * @param systemID The system identifier of the external entity being referenced.
286N/A * @param baseURI Absolute base URI associated with systemId.
286N/A * @param namespace The namespace of the entity to resolve.
286N/A * @return The resource requested or null.
286N/A * @throws XMLStreamException if there was a failure attempting to resolve the resource.
286N/A */
286N/A public Object resolveEntity(String publicID,
286N/A String systemID,
286N/A String baseURI,
286N/A String namespace)
286N/A throws XMLStreamException;
286N/A}