35 import javax.xml.parsers.ParserConfigurationException; 36 import javax.xml.parsers.SAXParserFactory; 37 38 import com.sun.org.apache.xml.internal.resolver.Catalog; 39 import com.sun.org.apache.xml.internal.resolver.CatalogManager; 40 import com.sun.org.apache.xml.internal.resolver.helpers.FileURL; 41 42 /** 43 * A SAX EntityResolver/JAXP URIResolver that uses catalogs. 44 * 45 * <p>This class implements both a SAX EntityResolver and a JAXP URIResolver. 46 * </p> 47 * 48 * <p>This resolver understands OASIS TR9401 catalogs, XCatalogs, and the 49 * current working draft of the OASIS Entity Resolution Technical 50 * Committee specification.</p> 51 * 52 * @see Catalog 53 * @see org.xml.sax.EntityResolver 54 * @see javax.xml.transform.URIResolver 55 * 56 * @author Norman Walsh 57 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a> 58 * 59 * @version 1.0 60 */ 61 public class CatalogResolver implements EntityResolver, URIResolver { 62 /** Make the parser Namespace aware? */ 63 public boolean namespaceAware = true; 64 65 /** Make the parser validating? */ 66 public boolean validating = false; 67 68 /** The underlying catalog */ 69 private Catalog catalog = null; 70 71 /** The catalog manager */ 72 private CatalogManager catalogManager = CatalogManager.getStaticManager(); 73 74 /** Constructor */ 75 public CatalogResolver() { 76 initializeCatalogs(false); 77 } 78 79 /** Constructor */ 80 public CatalogResolver(boolean privateCatalog) { | 35 import javax.xml.parsers.ParserConfigurationException; 36 import javax.xml.parsers.SAXParserFactory; 37 38 import com.sun.org.apache.xml.internal.resolver.Catalog; 39 import com.sun.org.apache.xml.internal.resolver.CatalogManager; 40 import com.sun.org.apache.xml.internal.resolver.helpers.FileURL; 41 42 /** 43 * A SAX EntityResolver/JAXP URIResolver that uses catalogs. 44 * 45 * <p>This class implements both a SAX EntityResolver and a JAXP URIResolver. 46 * </p> 47 * 48 * <p>This resolver understands OASIS TR9401 catalogs, XCatalogs, and the 49 * current working draft of the OASIS Entity Resolution Technical 50 * Committee specification.</p> 51 * 52 * @see Catalog 53 * @see org.xml.sax.EntityResolver 54 * @see javax.xml.transform.URIResolver 55 * @deprecated The JDK internal Catalog API in package 56 * {@code com.sun.org.apache.xml.internal.resolver} 57 * is encapsulated in JDK 9. The entire implementation under the package is now 58 * deprecated and subject to removal in a future release. Users of the API 59 * should migrate to the {@linkplain javax.xml.catalog new public API}. 60 * <p> 61 * The new Catalog API is supported throughout the JDK XML Processors, which allows 62 * the use of Catalog by simply setting a path to a Catalog file as a property. 63 * 64 * @author Norman Walsh 65 * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a> 66 * 67 * @version 1.0 68 */ 69 @Deprecated(since="9", forRemoval=true) 70 public class CatalogResolver implements EntityResolver, URIResolver { 71 /** Make the parser Namespace aware? */ 72 public boolean namespaceAware = true; 73 74 /** Make the parser validating? */ 75 public boolean validating = false; 76 77 /** The underlying catalog */ 78 private Catalog catalog = null; 79 80 /** The catalog manager */ 81 private CatalogManager catalogManager = CatalogManager.getStaticManager(); 82 83 /** Constructor */ 84 public CatalogResolver() { 85 initializeCatalogs(false); 86 } 87 88 /** Constructor */ 89 public CatalogResolver(boolean privateCatalog) { |