1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package com.sun.org.apache.xerces.internal.xni.parser; 23 24 import java.io.IOException; 25 26 import com.sun.org.apache.xerces.internal.xni.XNIException; 27 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; 28 29 /** 30 * This interface is used to resolve external parsed entities. The 31 * application can register an object that implements this interface 32 * with the parser configuration in order to intercept entities and 33 * resolve them explicitly. If the registered entity resolver cannot 34 * resolve the entity, it should return <code>null</code> so that the 35 * parser will try to resolve the entity using a default mechanism. 36 * 37 * @see XMLParserConfiguration 38 * 39 * @author Andy Clark, IBM 40 * 41 */ 42 public interface XMLEntityResolver { 43 44 // 45 // XMLEntityResolver methods 46 // 47 48 /** 49 * Resolves an external parsed entity. If the entity cannot be 50 * resolved, this method should return null. 51 * 52 * @param resourceIdentifier location of the XML resource to resolve 53 * 54 * @throws XNIException Thrown on general error. 55 * @throws IOException Thrown if resolved entity stream cannot be 56 * opened or some other i/o error occurs. 57 * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier 58 */ resolveEntity(XMLResourceIdentifier resourceIdentifier)59 public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) 60 throws XNIException, IOException; 61 62 } // interface XMLEntityResolver 63