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/readers DOMCatalogReader.java ExtendedXMLCatalogReader.java OASISXMLCatalogReader.java SAXCatalogReader.java TR9401CatalogReader.java TextCatalogReader.java XCatalogReader.java
Date Wed, 13 Nov 2002 20:50:49 GMT
ndw         2002/11/13 12:50:49

  Modified:    java/src/org/apache/xml/resolver/readers
                        DOMCatalogReader.java ExtendedXMLCatalogReader.java
                        OASISXMLCatalogReader.java SAXCatalogReader.java
                        TR9401CatalogReader.java TextCatalogReader.java
                        XCatalogReader.java
  Log:
  Rely on the catalog for which we are reading to provide the debug object for printing messages.
  
  Revision  Changes    Path
  1.2       +9 -8      xml-commons/java/src/org/apache/xml/resolver/readers/DOMCatalogReader.java
  
  Index: DOMCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/DOMCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ DOMCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -229,11 +229,12 @@
   
       if (domParserClass == null) {
         if (namespaceURI == null) {
  -	Debug.message(1, "No Catalog parser for " + localName);
  +	catalog.getCatalogManager().debug.message(1, "No Catalog parser for "
  +						  + localName);
         } else {
  -	Debug.message(1, "No Catalog parser for "
  -		      + "{" + namespaceURI + "}"
  -		      + localName);
  +	catalog.getCatalogManager().debug.message(1, "No Catalog parser for "
  +						  + "{" + namespaceURI + "}"
  +						  + localName);
         }
         return;
       }
  @@ -243,16 +244,16 @@
       try {
         domParser = (DOMCatalogParser) Class.forName(domParserClass).newInstance();
       } catch (ClassNotFoundException cnfe) {
  -      Debug.message(1, "Cannot load XML Catalog Parser class", domParserClass);
  +      catalog.getCatalogManager().debug.message(1, "Cannot load XML Catalog Parser class",
domParserClass);
         throw new CatalogException(CatalogException.UNPARSEABLE);
       } catch (InstantiationException ie) {
  -      Debug.message(1, "Cannot instantiate XML Catalog Parser class", domParserClass);
  +      catalog.getCatalogManager().debug.message(1, "Cannot instantiate XML Catalog Parser
class", domParserClass);
         throw new CatalogException(CatalogException.UNPARSEABLE);
       } catch (IllegalAccessException iae) {
  -      Debug.message(1, "Cannot access XML Catalog Parser class", domParserClass);
  +      catalog.getCatalogManager().debug.message(1, "Cannot access XML Catalog Parser class",
domParserClass);
         throw new CatalogException(CatalogException.UNPARSEABLE);
       } catch (ClassCastException cce ) {
  -      Debug.message(1, "Cannot cast XML Catalog Parser class", domParserClass);
  +      catalog.getCatalogManager().debug.message(1, "Cannot cast XML Catalog Parser class",
domParserClass);
         throw new CatalogException(CatalogException.UNPARSEABLE);
       }
   
  
  
  
  1.2       +11 -11    xml-commons/java/src/org/apache/xml/resolver/readers/ExtendedXMLCatalogReader.java
  
  Index: ExtendedXMLCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/ExtendedXMLCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExtendedXMLCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ ExtendedXMLCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -132,16 +132,16 @@
   	entryArgs.add(baseURI);
   	baseURIStack.push(baseURI);
   
  -	Debug.message(4, "xml:base", baseURI);
  +	debug.message(4, "xml:base", baseURI);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (base)", localName);
  +	    debug.message(1, "Invalid catalog entry (base)", localName);
   	  }
   	}
   
  @@ -157,7 +157,7 @@
   	  entryArgs.add(atts.getValue("suffix"));
   	  entryArgs.add(atts.getValue("uri"));
   
  -	  Debug.message(4, "uriSuffix",
  +	  debug.message(4, "uriSuffix",
   			atts.getValue("suffix"),
   			atts.getValue("uri"));
   	}
  @@ -167,13 +167,13 @@
   	  entryArgs.add(atts.getValue("suffix"));
   	  entryArgs.add(atts.getValue("uri"));
   
  -	  Debug.message(4, "systemSuffix",
  +	  debug.message(4, "systemSuffix",
   			atts.getValue("suffix"),
   			atts.getValue("uri"));
   	}
         } else {
   	// This is equivalent to an invalid catalog entry type
  -	Debug.message(1, "Invalid catalog entry type", localName);
  +	debug.message(1, "Invalid catalog entry type", localName);
         }
   
         if (entryType >= 0) {
  @@ -182,9 +182,9 @@
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry", localName);
  +	    debug.message(1, "Invalid catalog entry", localName);
   	  }
   	}
         }
  @@ -217,16 +217,16 @@
   	entryType = catalog.BASE;
   	entryArgs.add(baseURI);
   
  -	Debug.message(4, "(reset) xml:base", baseURI);
  +	debug.message(4, "(reset) xml:base", baseURI);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (rbase)", localName);
  +	    debug.message(1, "Invalid catalog entry (rbase)", localName);
   	  }
   	}
         }
  
  
  
  1.2       +35 -34    xml-commons/java/src/org/apache/xml/resolver/readers/OASISXMLCatalogReader.java
  
  Index: OASISXMLCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/OASISXMLCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OASISXMLCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ OASISXMLCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -91,8 +91,8 @@
    */
   public class OASISXMLCatalogReader extends SAXCatalogReader implements SAXCatalogParser
{
     /** The catalog object needs to be stored by the object so that
  -     * SAX callbacks can use it.
  -     */
  +   * SAX callbacks can use it.
  +   */
     protected Catalog catalog = null;
   
     /** The namespace name of OASIS ERTC catalogs */
  @@ -108,6 +108,7 @@
     /** Set the current catalog. */
     public void setCatalog (Catalog catalog) {
       this.catalog = catalog;
  +    debug = catalog.getCatalogManager().debug;
     }
   
     /** Get the current catalog. */
  @@ -195,16 +196,16 @@
   	entryArgs.add(baseURI);
   	baseURIStack.push(baseURI);
   
  -	Debug.message(4, "xml:base", baseURI);
  +	debug.message(4, "xml:base", baseURI);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (base)", localName);
  +	    debug.message(1, "Invalid catalog entry (base)", localName);
   	  }
   	}
   
  @@ -224,7 +225,7 @@
   	} else if (override.equals("system")) {
   	  override = "no";
   	} else {
  -	  Debug.message(1,
  +	  debug.message(1,
   			"Invalid prefer: must be 'system' or 'public'",
   			localName);
   	  override = catalog.getDefaultOverride();
  @@ -234,16 +235,16 @@
   	entryArgs.add(override);
   	overrideStack.push(override);
   
  -	Debug.message(4, "override", override);
  +	debug.message(4, "override", override);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (override)", localName);
  +	    debug.message(1, "Invalid catalog entry (override)", localName);
   	  }
   	}
   
  @@ -260,7 +261,7 @@
   	  entryArgs.add(atts.getValue("publicIdStartString"));
   	  entryArgs.add(atts.getValue("catalog"));
   
  -	  Debug.message(4, "delegatePublic",
  +	  debug.message(4, "delegatePublic",
   			PublicId.normalize(atts.getValue("publicIdStartString")),
   			atts.getValue("catalog"));
   	}
  @@ -270,7 +271,7 @@
   	  entryArgs.add(atts.getValue("systemIdStartString"));
   	  entryArgs.add(atts.getValue("catalog"));
   
  -	  Debug.message(4, "delegateSystem",
  +	  debug.message(4, "delegateSystem",
   			atts.getValue("systemIdStartString"),
   			atts.getValue("catalog"));
   	}
  @@ -280,7 +281,7 @@
   	  entryArgs.add(atts.getValue("uriStartString"));
   	  entryArgs.add(atts.getValue("catalog"));
   
  -	  Debug.message(4, "delegateURI",
  +	  debug.message(4, "delegateURI",
   			atts.getValue("uriStartString"),
   			atts.getValue("catalog"));
   	}
  @@ -290,7 +291,7 @@
   	  entryArgs.add(atts.getValue("systemIdStartString"));
   	  entryArgs.add(atts.getValue("rewritePrefix"));
   
  -	  Debug.message(4, "rewriteSystem",
  +	  debug.message(4, "rewriteSystem",
   			atts.getValue("systemIdStartString"),
   			atts.getValue("rewritePrefix"));
   	}
  @@ -300,7 +301,7 @@
   	  entryArgs.add(atts.getValue("uriStartString"));
   	  entryArgs.add(atts.getValue("rewritePrefix"));
   
  -	  Debug.message(4, "rewriteURI",
  +	  debug.message(4, "rewriteURI",
   			atts.getValue("uriStartString"),
   			atts.getValue("rewritePrefix"));
   	}
  @@ -309,7 +310,7 @@
   	  entryType = Catalog.CATALOG;
   	  entryArgs.add(atts.getValue("catalog"));
   
  -	  Debug.message(4, "nextCatalog", atts.getValue("catalog"));
  +	  debug.message(4, "nextCatalog", atts.getValue("catalog"));
   	}
         } else if (localName.equals("public")) {
   	if (checkAttributes(atts, "publicId", "uri")) {
  @@ -317,7 +318,7 @@
   	  entryArgs.add(atts.getValue("publicId"));
   	  entryArgs.add(atts.getValue("uri"));
   
  -	  Debug.message(4, "public",
  +	  debug.message(4, "public",
   			PublicId.normalize(atts.getValue("publicId")),
   			atts.getValue("uri"));
   	}
  @@ -327,7 +328,7 @@
   	  entryArgs.add(atts.getValue("systemId"));
   	  entryArgs.add(atts.getValue("uri"));
   
  -	  Debug.message(4, "system",
  +	  debug.message(4, "system",
   			atts.getValue("systemId"),
   			atts.getValue("uri"));
   	}
  @@ -337,7 +338,7 @@
   	  entryArgs.add(atts.getValue("name"));
   	  entryArgs.add(atts.getValue("uri"));
   
  -	  Debug.message(4, "uri",
  +	  debug.message(4, "uri",
   			atts.getValue("name"),
   			atts.getValue("uri"));
   	}
  @@ -347,7 +348,7 @@
   	// nop, a group
         } else {
   	// This is equivalent to an invalid catalog entry type
  -	Debug.message(1, "Invalid catalog entry type", localName);
  +	debug.message(1, "Invalid catalog entry type", localName);
         }
   
         if (entryType >= 0) {
  @@ -356,9 +357,9 @@
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry", localName);
  +	    debug.message(1, "Invalid catalog entry", localName);
   	  }
   	}
         }
  @@ -374,16 +375,16 @@
   	entryArgs.add(baseURI);
   	baseURIStack.push(baseURI);
   
  -	Debug.message(4, "xml:base", baseURI);
  +	debug.message(4, "xml:base", baseURI);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (base)", localName);
  +	    debug.message(1, "Invalid catalog entry (base)", localName);
   	  }
   	}
   
  @@ -422,7 +423,7 @@
   	entryArgs.add(atts.getValue("uri"));
         } else {
   	// This is equivalent to an invalid catalog entry type
  -	Debug.message(1, "Invalid catalog entry type", localName);
  +	debug.message(1, "Invalid catalog entry type", localName);
         }
   
         if (entryType >= 0) {
  @@ -431,9 +432,9 @@
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry", localName);
  +	    debug.message(1, "Invalid catalog entry", localName);
   	  }
   	}
         }
  @@ -442,7 +443,7 @@
   
     public boolean checkAttributes (Attributes atts, String attName) {
       if (atts.getValue(attName) == null) {
  -      Debug.message(1, "Error: required attribute " + attName + " missing.");
  +      debug.message(1, "Error: required attribute " + attName + " missing.");
         return false;
       } else {
         return true;
  @@ -479,16 +480,16 @@
   	entryType = catalog.BASE;
   	entryArgs.add(baseURI);
   
  -	Debug.message(4, "(reset) xml:base", baseURI);
  +	debug.message(4, "(reset) xml:base", baseURI);
   
   	try {
   	  CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	  catalog.addEntry(ce);
   	} catch (CatalogException cex) {
   	  if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	    Debug.message(1, "Invalid catalog entry type", localName);
  +	    debug.message(1, "Invalid catalog entry type", localName);
   	  } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	    Debug.message(1, "Invalid catalog entry (rbase)", localName);
  +	    debug.message(1, "Invalid catalog entry (rbase)", localName);
   	  }
   	}
         }
  @@ -505,16 +506,16 @@
   	  entryArgs.add(override);
   	  overrideStack.push(override);
   
  -	  Debug.message(4, "(reset) override", override);
  +	  debug.message(4, "(reset) override", override);
   
   	  try {
   	    CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
   	    catalog.addEntry(ce);
   	  } catch (CatalogException cex) {
   	    if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	      Debug.message(1, "Invalid catalog entry type", localName);
  +	      debug.message(1, "Invalid catalog entry type", localName);
   	    } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	      Debug.message(1, "Invalid catalog entry (roverride)", localName);
  +	      debug.message(1, "Invalid catalog entry (roverride)", localName);
   	    }
   	  }
   	}
  
  
  
  1.2       +46 -30    xml-commons/java/src/org/apache/xml/resolver/readers/SAXCatalogReader.java
  
  Index: SAXCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/SAXCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SAXCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ SAXCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -71,6 +71,7 @@
   import java.net.MalformedURLException;
   import java.net.UnknownHostException;
   import org.apache.xml.resolver.Catalog;
  +import org.apache.xml.resolver.CatalogManager;
   import org.apache.xml.resolver.CatalogEntry;
   import org.apache.xml.resolver.CatalogException;
   import org.apache.xml.resolver.readers.CatalogReader;
  @@ -159,6 +160,33 @@
       return parserClass;
     }
   
  +  /** The debug class to use for this reader.
  +   *
  +   * This is a bit of a hack. Anyway, whenever we read for a catalog,
  +   * we extract the debug object
  +   * from the catalog's manager so that we can use it to print messages.
  +   *
  +   * In production, we don't really expect any messages so it doesn't
  +   * really matter. But it's still a bit of a hack.
  +   */
  +  protected Debug debug = CatalogManager.getStaticManager().debug;
  +
  +  /** The constructor */
  +  public SAXCatalogReader() {
  +    parserFactory = null;
  +    parserClass = null;
  +  }
  +
  +  /** The constructor */
  +  public SAXCatalogReader(SAXParserFactory parserFactory) {
  +    this.parserFactory = parserFactory;
  +  }
  +
  +  /** The constructor */
  +  public SAXCatalogReader(String parserClass) {
  +    this.parserClass = parserClass;
  +  }
  +
     /** Set the SAXCatalogParser class for the given namespace/root
        * element type.
        */
  @@ -184,22 +212,6 @@
       }
     }
   
  -  /** The constructor */
  -  public SAXCatalogReader() {
  -    parserFactory = null;
  -    parserClass = null;
  -  }
  -
  -  /** The constructor */
  -  public SAXCatalogReader(SAXParserFactory parserFactory) {
  -    this.parserFactory = parserFactory;
  -  }
  -
  -  /** The constructor */
  -  public SAXCatalogReader(String parserClass) {
  -    this.parserClass = parserClass;
  -  }
  -
     /**
      * <p>Parse an XML Catalog file.</p>
      *
  @@ -221,11 +233,13 @@
         url = new URL("file:///" + fileUrl);
       }
   
  +    debug = catalog.getCatalogManager().debug;
  +
       try {
         URLConnection urlCon = url.openConnection();
         readCatalog(catalog, urlCon.getInputStream());
       } catch (FileNotFoundException e) {
  -      Debug.message(1, "Failed to load catalog, file not found",
  +      catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
   		    url.toString());
       }
     }
  @@ -245,10 +259,12 @@
   
       // Create an instance of the parser
       if (parserFactory == null && parserClass == null) {
  -      Debug.message(1, "Cannot read SAX catalog without a parser");
  +      debug.message(1, "Cannot read SAX catalog without a parser");
         throw new CatalogException(CatalogException.UNPARSEABLE);
       }
   
  +    debug = catalog.getCatalogManager().debug;
  +
       this.catalog = catalog;
   
       try {
  @@ -350,9 +366,9 @@
         if (saxParserClass == null) {
   	abandonHope = true;
   	if (namespaceURI == null) {
  -	  Debug.message(2, "No Catalog parser for " + name);
  +	  debug.message(2, "No Catalog parser for " + name);
   	} else {
  -	  Debug.message(2, "No Catalog parser for "
  +	  debug.message(2, "No Catalog parser for "
   			+ "{" + namespaceURI + "}"
   			+ name);
   	}
  @@ -369,19 +385,19 @@
         } catch (ClassNotFoundException cnfe) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, cnfe.toString());
  +	debug.message(2, cnfe.toString());
         } catch (InstantiationException ie) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, ie.toString());
  +	debug.message(2, ie.toString());
         } catch (IllegalAccessException iae) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, iae.toString());
  +	debug.message(2, iae.toString());
         } catch (ClassCastException cce ) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, cce.toString());
  +	debug.message(2, cce.toString());
         }
       } else {
         saxParser.startElement(name, atts);
  @@ -411,9 +427,9 @@
         if (saxParserClass == null) {
   	abandonHope = true;
   	if (namespaceURI == null) {
  -	  Debug.message(2, "No Catalog parser for " + localName);
  +	  debug.message(2, "No Catalog parser for " + localName);
   	} else {
  -	  Debug.message(2, "No Catalog parser for "
  +	  debug.message(2, "No Catalog parser for "
   			+ "{" + namespaceURI + "}"
   			+ localName);
   	}
  @@ -430,19 +446,19 @@
         } catch (ClassNotFoundException cnfe) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, cnfe.toString());
  +	debug.message(2, cnfe.toString());
         } catch (InstantiationException ie) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, ie.toString());
  +	debug.message(2, ie.toString());
         } catch (IllegalAccessException iae) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, iae.toString());
  +	debug.message(2, iae.toString());
         } catch (ClassCastException cce ) {
   	saxParser = null;
   	abandonHope = true;
  -	Debug.message(2, cce.toString());
  +	debug.message(2, cce.toString());
         }
       } else {
         saxParser.startElement(namespaceURI, localName, qName, atts);
  
  
  
  1.2       +1 -1      xml-commons/java/src/org/apache/xml/resolver/readers/TR9401CatalogReader.java
  
  Index: TR9401CatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/TR9401CatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TR9401CatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ TR9401CatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -170,7 +170,7 @@
   	  }
   	  unknownEntry.addElement(token);
   	} else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	  Debug.message(1, "Invalid catalog entry", token);
  +	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", token);
   	  unknownEntry = null;
   	}
         }
  
  
  
  1.2       +3 -3      xml-commons/java/src/org/apache/xml/resolver/readers/TextCatalogReader.java
  
  Index: TextCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/TextCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TextCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ TextCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -147,8 +147,8 @@
       try {
         readCatalog(catalog, urlCon.getInputStream());
       } catch (FileNotFoundException e) {
  -      Debug.message(1, "Failed to load catalog, file not found",
  -		    catURL.toString());
  +      catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
  +						catURL.toString());
       }
     }
   
  @@ -205,7 +205,7 @@
   	  }
   	  unknownEntry.addElement(token);
   	} else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	  Debug.message(1, "Invalid catalog entry", token);
  +	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", token);
   	  unknownEntry = null;
   	}
         }
  
  
  
  1.2       +44 -44    xml-commons/java/src/org/apache/xml/resolver/readers/XCatalogReader.java
  
  Index: XCatalogReader.java
  ===================================================================
  RCS file: /home/cvs/xml-commons/java/src/org/apache/xml/resolver/readers/XCatalogReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XCatalogReader.java	30 Jan 2002 12:25:00 -0000	1.1
  +++ XCatalogReader.java	13 Nov 2002 20:50:49 -0000	1.2
  @@ -90,45 +90,45 @@
    * @version 1.0
    */
   public class XCatalogReader extends SAXCatalogReader implements SAXCatalogParser {
  -    /** The catalog object needs to be stored by the object so that
  -     * SAX callbacks can use it.
  -     */
  -    protected Catalog catalog = null;
  -
  -    /** Set the current catalog. */
  -    public void setCatalog (Catalog catalog) {
  -	this.catalog = catalog;
  -    }
  -
  -    /** Get the current catalog. */
  -    public Catalog getCatalog () {
  -	return catalog;
  -    }
  -
  -    /** The constructor */
  -    public XCatalogReader(SAXParserFactory parserFactory) {
  -      super(parserFactory);
  -    }
  -
  -    // ----------------------------------------------------------------------
  -    // Implement the SAX DocumentHandler interface
  +  /** The catalog object needs to be stored by the object so that
  +   * SAX callbacks can use it.
  +   */
  +  protected Catalog catalog = null;
   
  -    /** <p>The SAX <code>setDocumentLocator</code> method does nothing.</p>
*/
  -    public void setDocumentLocator (Locator locator) {
  -	return;
  -    }
  +  /** Set the current catalog. */
  +  public void setCatalog (Catalog catalog) {
  +    this.catalog = catalog;
  +  }
  +
  +  /** Get the current catalog. */
  +  public Catalog getCatalog () {
  +    return catalog;
  +  }
  +
  +  /** The constructor */
  +  public XCatalogReader(SAXParserFactory parserFactory) {
  +    super(parserFactory);
  +  }
  +
  +  // ----------------------------------------------------------------------
  +  // Implement the SAX DocumentHandler interface
  +
  +  /** <p>The SAX <code>setDocumentLocator</code> method does nothing.</p>
*/
  +  public void setDocumentLocator (Locator locator) {
  +    return;
  +  }
   
  -    /** <p>The SAX <code>startDocument</code> method does nothing.</p>
*/
  -    public void startDocument ()
  -	throws SAXException {
  -	return;
  -    }
  +  /** <p>The SAX <code>startDocument</code> method does nothing.</p>
*/
  +  public void startDocument ()
  +    throws SAXException {
  +    return;
  +  }
   
  -    /** <p>The SAX <code>endDocument</code> method does nothing.</p>
*/
  -    public void endDocument ()
  -	throws SAXException {
  -	return;
  -    }
  +  /** <p>The SAX <code>endDocument</code> method does nothing.</p>
*/
  +  public void endDocument ()
  +    throws SAXException {
  +    return;
  +  }
   
     /**
      * <p>The SAX <code>startElement</code> method recognizes elements
  @@ -155,26 +155,26 @@
         entryType = catalog.BASE;
         entryArgs.add(atts.getValue("HRef"));
   
  -      Debug.message(4, "Base", atts.getValue("HRef"));
  +      catalog.getCatalogManager().debug.message(4, "Base", atts.getValue("HRef"));
       } else if (localName.equals("Delegate")) {
         entryType = catalog.DELEGATE_PUBLIC;
         entryArgs.add(atts.getValue("PublicId"));
         entryArgs.add(atts.getValue("HRef"));
   
  -      Debug.message(4, "Delegate",
  +      catalog.getCatalogManager().debug.message(4, "Delegate",
   		    PublicId.normalize(atts.getValue("PublicId")),
   		    atts.getValue("HRef"));
       } else if (localName.equals("Extend")) {
         entryType = catalog.CATALOG;
         entryArgs.add(atts.getValue("HRef"));
   
  -      Debug.message(4, "Extend", atts.getValue("HRef"));
  +      catalog.getCatalogManager().debug.message(4, "Extend", atts.getValue("HRef"));
       } else if (localName.equals("Map")) {
         entryType = catalog.PUBLIC;
         entryArgs.add(atts.getValue("PublicId"));
         entryArgs.add(atts.getValue("HRef"));
   
  -      Debug.message(4, "Map",
  +      catalog.getCatalogManager().debug.message(4, "Map",
   		    PublicId.normalize(atts.getValue("PublicId")),
   		    atts.getValue("HRef"));
       } else if (localName.equals("Remap")) {
  @@ -182,14 +182,14 @@
         entryArgs.add(atts.getValue("SystemId"));
         entryArgs.add(atts.getValue("HRef"));
   
  -      Debug.message(4, "Remap",
  +      catalog.getCatalogManager().debug.message(4, "Remap",
   		    atts.getValue("SystemId"),
   		    atts.getValue("HRef"));
       } else if (localName.equals("XMLCatalog")) {
         // nop, start of catalog
       } else {
         // This is equivalent to an invalid catalog entry type
  -      Debug.message(1, "Invalid catalog entry type", localName);
  +      catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
       }
   
       if (entryType >= 0) {
  @@ -198,9 +198,9 @@
   	catalog.addEntry(ce);
         } catch (CatalogException cex) {
   	if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
  -	  Debug.message(1, "Invalid catalog entry type", localName);
  +	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
   	} else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
  -	  Debug.message(1, "Invalid catalog entry", localName);
  +	  catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", localName);
   	}
         }
       }
  
  
  

Mime
View raw message