Class DebugHandler

java.lang.Object
org.exolab.castor.xml.DebugHandler
All Implemented Interfaces:
DocumentHandler

public class DebugHandler extends Object implements DocumentHandler
A Simple SAX1 DocumentHandler that intercepts SAX events and prints them to the console. This class is not used during normal Castor operation, but exists so that during debugging one can replace a normal DocumentHandler with this one (which will proxy to the correct DocumentHandler).

FIXME: As Castor moves internally to the SAX2 interface, this class should also be updated for SAX2.

Version:
$Revision: 6784 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Keith Visco
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new DebugHandler which forwards events to the given document handler.
    Creates a new DebugHandler which forwards events to the given document handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    characters(char[] ch, int start, int length)
    Proxies the org.sax.xml.DocumentHandler#characters(char[], int, int) request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#endDocument() request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#endElement(String) request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    ignorableWhitespace(char[] ch, int start, int length)
    Proxies the org.sax.xml.DocumentHandler#ignorableWhitespace(char[], int, int) request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#processingInstruction(String, String) request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#setDocumentLocator(Locator) request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#startDocument() request to the proxy that is provided, printing debugging information before doing the proxy.
    void
    Proxies the org.sax.xml.DocumentHandler#startElement(String, AttributeList) request to the proxy that is provided, printing debugging information before doing the proxy.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DebugHandler

      public DebugHandler(DocumentHandler handler)
      Creates a new DebugHandler which forwards events to the given document handler.
      Parameters:
      handler - the DocumentHandler to forward events to
    • DebugHandler

      public DebugHandler(DocumentHandler handler, Writer out)
      Creates a new DebugHandler which forwards events to the given document handler.
      Parameters:
      handler - the DocumentHandler to forward events to
      out - the Writer to print debug information to
  • Method Details

    • characters

      public void characters(char[] ch, int start, int length) throws SAXException
      Proxies the org.sax.xml.DocumentHandler#characters(char[], int, int) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      characters in interface DocumentHandler
      Throws:
      SAXException
    • endDocument

      public void endDocument() throws SAXException
      Proxies the org.sax.xml.DocumentHandler#endDocument() request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      endDocument in interface DocumentHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String name) throws SAXException
      Proxies the org.sax.xml.DocumentHandler#endElement(String) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      endElement in interface DocumentHandler
      Throws:
      SAXException
    • ignorableWhitespace

      public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
      Proxies the org.sax.xml.DocumentHandler#ignorableWhitespace(char[], int, int) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      ignorableWhitespace in interface DocumentHandler
      Throws:
      SAXException
    • processingInstruction

      public void processingInstruction(String target, String data) throws SAXException
      Proxies the org.sax.xml.DocumentHandler#processingInstruction(String, String) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      processingInstruction in interface DocumentHandler
      Throws:
      SAXException
    • setDocumentLocator

      public void setDocumentLocator(Locator locator)
      Proxies the org.sax.xml.DocumentHandler#setDocumentLocator(Locator) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      setDocumentLocator in interface DocumentHandler
    • startDocument

      public void startDocument() throws SAXException
      Proxies the org.sax.xml.DocumentHandler#startDocument() request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      startDocument in interface DocumentHandler
      Throws:
      SAXException
    • startElement

      public void startElement(String name, AttributeList atts) throws SAXException
      Proxies the org.sax.xml.DocumentHandler#startElement(String, AttributeList) request to the proxy that is provided, printing debugging information before doing the proxy.
      Specified by:
      startElement in interface DocumentHandler
      Throws:
      SAXException