xml-commons-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject cvs commit: xml-commons/java/src/org/apache/xml/resolver/tools ResolvingXMLFilter.java
Date Wed, 13 Nov 2002 20:53:14 GMT
ndw         2002/11/13 12:53:13

  Modified:    java/src/org/apache/xml/resolver/tools
                        ResolvingXMLFilter.java
  Log:
  Add interfaces for constructing a filter with a particular CatalogManager
  
  Revision  Changes    Path
  1.2       +28 -9     xml-commons/java/src/org/apache/xml/resolver/tools/ResolvingXMLFilter.java
  
  Index: ResolvingXMLFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/tools/ResolvingXMLFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResolvingXMLFilter.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ ResolvingXMLFilter.java	13 Nov 2002 20:53:12 -0000	1.2
  @@ -96,8 +96,11 @@
      */
     public static boolean suppressExplanation = false;
   
  +  /** The manager for the underlying resolver */
  +  private CatalogManager catalogManager = CatalogManager.getStaticManager();
  +
     /** The underlying catalog resolver */
  -  private CatalogResolver catalogResolver = new CatalogResolver();
  +  private CatalogResolver catalogResolver = null;
   
     /** A separate resolver for oasis-xml-pi catalogs */
     private CatalogResolver piCatalogResolver = null;
  @@ -114,11 +117,27 @@
     /** Construct an empty XML Filter with no parent */
     public ResolvingXMLFilter() {
       super();
  +    catalogResolver = new CatalogResolver(catalogManager);
     }
   
     /** Construct an XML filter with the specified parent */
     public ResolvingXMLFilter(XMLReader parent) {
       super(parent);
  +    catalogResolver = new CatalogResolver(catalogManager);
  +  }
  +
  +  /** Construct an XML filter with the specified parent */
  +  public ResolvingXMLFilter(CatalogManager manager) {
  +    super();
  +    catalogManager = manager;
  +    catalogResolver = new CatalogResolver(catalogManager);
  +  }
  +
  +  /** Construct an XML filter with the specified parent */
  +  public ResolvingXMLFilter(XMLReader parent, CatalogManager manager) {
  +    super(parent);
  +    catalogManager = manager;
  +    catalogResolver = new CatalogResolver(catalogManager);
     }
   
     /**
  @@ -216,7 +235,7 @@
   
   	return iSource;
         } catch (Exception e) {
  -	Debug.message(1, "Failed to create InputSource", resolved);
  +	catalogManager.debug.message(1, "Failed to create InputSource", resolved);
   	return null;
         }
       } else {
  @@ -297,12 +316,12 @@
         }
   
         if (allowXMLCatalogPI) {
  -	if (CatalogManager.allowOasisXMLCatalogPI()) {
  -	  Debug.message(4,"oasis-xml-catalog PI", pidata);
  +	if (catalogManager.allowOasisXMLCatalogPI()) {
  +	  catalogManager.debug.message(4,"oasis-xml-catalog PI", pidata);
   
   	  if (catalog != null) {
   	    try {
  -	      Debug.message(4,"oasis-xml-catalog", catalog.toString());
  +	      catalogManager.debug.message(4,"oasis-xml-catalog", catalog.toString());
   	      oasisXMLCatalogPI = true;
   
   	      if (piCatalogResolver == null) {
  @@ -311,17 +330,17 @@
   
   	      piCatalogResolver.getCatalog().parseCatalog(catalog.toString());
   	    } catch (Exception e) {
  -	      Debug.message(3, "Exception parsing oasis-xml-catalog: "
  +	      catalogManager.debug.message(3, "Exception parsing oasis-xml-catalog: "
   			    + catalog.toString());
   	    }
   	  } else {
  -	    Debug.message(3, "PI oasis-xml-catalog unparseable: " + pidata);
  +	    catalogManager.debug.message(3, "PI oasis-xml-catalog unparseable: " + pidata);
   	  }
   	} else {
  -	  Debug.message(4,"PI oasis-xml-catalog ignored: " + pidata);
  +	  catalogManager.debug.message(4,"PI oasis-xml-catalog ignored: " + pidata);
   	}
         } else {
  -	Debug.message(3, "PI oasis-xml-catalog occurred in an invalid place: "
  +	catalogManager.debug.message(3, "PI oasis-xml-catalog occurred in an invalid place: "
   		      + pidata);
         }
       } else {
  
  
  

Mime
View raw message