1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 package org.netbeans.editor.ext.html.dtd; 20 21 import java.io.Reader; 22 import java.util.Collection; 23 24 /** 25 * DTDReaderProvider is interface used as a source of Readers used to parse DTD 26 * by DTDParser. One DTDReaderProvider shall offer all Readers for a given DTD, 27 * i.e. the provider for "-//W3C//DTD HTML 4.01//EN" shall also provide Readers 28 * for proper "-//W3C//ENTITIES Latin1//EN/HTML", as this public entity is 29 * referred from HTML 4.01 DTD and the file provided with 4.01 DTD differs 30 * from the file provided with 4.0 DTD although they have the same 31 * public identifier (They differ only in comments, though). 32 * 33 * @author Petr Nejedly 34 * @version 1.0 35 */ 36 public interface ReaderProvider { 37 38 /* Asks for Reader providing content of DTD file identified by 39 * given identifier, and possibly by given fileName. 40 * These parameters are typically obtained from invocation DTD directive 41 * like <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" "HTMLlat1.ent">, 42 * in this case, the string -//W3C//....//HTML" is identifier 43 * and "HTMLlat1.ent" is name of file in which it is probably stored 44 * @param identifier the public identifier of required DTD 45 * @param fileName the probable name of file with DTD data, may be 46 * <CODE>null</CODE>. It is used only as helper to identifier. 47 * @return Reader from which to read out the DTD content. 48 */ 49 public Reader getReaderForIdentifier( String identifier, String fileName ); 50 51 /** Asks for all the identifiers available from this ReaderProvider. 52 * @returns a Collection of all identifiers for which this ReaderProvider 53 * is able to provide Readers for. 54 */ 55 public Collection getIdentifiers(); 56 } 57