Path: blob/master/src/java.xml/share/classes/javax/xml/stream/XMLResolver.java
40948 views
/*1* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.stream;2627/**28* This interface is used to resolve resources during an XML parse. If an application wishes to29* perform custom entity resolution it must register an instance of this interface with30* the XMLInputFactory using the setXMLResolver method.31*32* @version 1.033* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.34* @since 1.635*/36public interface XMLResolver {3738/**39* Retrieves a resource. This resource can be of the following three return types:40* (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader.41* If this method returns null the processor will attempt to resolve the entity using its42* default mechanism.43*44* @param publicID The public identifier of the external entity being referenced, or null if none was supplied.45* @param systemID The system identifier of the external entity being referenced.46* @param baseURI Absolute base URI associated with systemId.47* @param namespace The namespace of the entity to resolve.48* @return The resource requested or null.49* @throws XMLStreamException if there was a failure attempting to resolve the resource.50*/51public Object resolveEntity(String publicID,52String systemID,53String baseURI,54String namespace)55throws XMLStreamException;56}575859