[Yanel-commits] rev 44038 - public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search

michi at wyona.com michi at wyona.com
Thu Aug 6 15:58:51 CEST 2009


Author: michi
Date: 2009-08-06 15:58:51 +0200 (Thu, 06 Aug 2009)
New Revision: 44038

Added:
   public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/DebugContentHandler.java
Log:
content handler for debugging added

Added: public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/DebugContentHandler.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/DebugContentHandler.java	                        (rev 0)
+++ public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/DebugContentHandler.java	2009-08-06 13:58:51 UTC (rev 44038)
@@ -0,0 +1,75 @@
+/**
+ * Licensed to Wyona
+ */
+package org.wyona.yanel.impl.resources.search;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Content handler for debugging document which has been generated by some parser implementation
+ */
+public class DebugContentHandler implements ContentHandler {
+
+   private static Logger log = Logger.getLogger(DebugContentHandler.class);
+
+   public void setDocumentLocator (Locator locator) { 
+	  log.warn("Hello from setDocumentLocator()!"); 
+	}
+
+    public void startDocument ()
+	throws SAXException  { 
+	  log.warn("Hello from startDocument()!"); 
+	}
+
+    public void endDocument()
+	throws SAXException {  
+	  log.warn("Hello from endDocument()!"); 
+	}
+
+    public void startPrefixMapping (String prefix, String uri)
+	throws SAXException {  
+	  log.warn("Hello from startPrefixMapping()!"); 
+	}
+
+    public void endPrefixMapping (String prefix)
+	throws SAXException  {  
+	  log.warn("Hello from endPrefixMapping()!"); 
+	}
+
+    public void startElement (String uri, String localName,
+			      String qName, Attributes atts)
+	throws SAXException  {  
+	  log.warn("Local name: " + localName); 
+	}
+
+    public void endElement (String uri, String localName,
+			    String qName)
+	throws SAXException {  
+	  log.warn("Local name: " + localName); 
+	}
+
+    public void characters (char ch[], int start, int length)
+	throws SAXException {  
+	  log.warn("Hello from characters()!"); 
+	}
+
+    public void ignorableWhitespace (char ch[], int start, int length)
+	throws SAXException {  
+	  log.warn("Hello from ignorableWhitespace()!"); 
+	}
+
+    public void processingInstruction (String target, String data)
+	throws SAXException {  
+	  log.warn("Hello from processingInstruction()!"); 
+	}
+
+    public void skippedEntity (String name)
+	throws SAXException {  
+	  log.warn("Hello from skippedEntity()!"); 
+	}
+}



More information about the Yanel-commits mailing list