Package org.exolab.castor.xml
Class DebugHandler
- java.lang.Object
-
- org.exolab.castor.xml.DebugHandler
-
- All Implemented Interfaces:
org.xml.sax.DocumentHandler
public class DebugHandler extends java.lang.Object implements org.xml.sax.DocumentHandlerA 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 DebugHandler(org.xml.sax.DocumentHandler handler)Creates a new DebugHandler which forwards events to the given document handler.DebugHandler(org.xml.sax.DocumentHandler handler, java.io.Writer out)Creates a new DebugHandler which forwards events to the given document handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(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.voidendDocument()Proxies the org.sax.xml.DocumentHandler#endDocument() request to the proxy that is provided, printing debugging information before doing the proxy.voidendElement(java.lang.String name)Proxies the org.sax.xml.DocumentHandler#endElement(String) request to the proxy that is provided, printing debugging information before doing the proxy.voidignorableWhitespace(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.voidprocessingInstruction(java.lang.String target, java.lang.String data)Proxies the org.sax.xml.DocumentHandler#processingInstruction(String, String) request to the proxy that is provided, printing debugging information before doing the proxy.voidsetDocumentLocator(org.xml.sax.Locator locator)Proxies the org.sax.xml.DocumentHandler#setDocumentLocator(Locator) request to the proxy that is provided, printing debugging information before doing the proxy.voidstartDocument()Proxies the org.sax.xml.DocumentHandler#startDocument() request to the proxy that is provided, printing debugging information before doing the proxy.voidstartElement(java.lang.String name, org.xml.sax.AttributeList atts)Proxies the org.sax.xml.DocumentHandler#startElement(String, AttributeList) request to the proxy that is provided, printing debugging information before doing the proxy.
-
-
-
Constructor Detail
-
DebugHandler
public DebugHandler(org.xml.sax.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(org.xml.sax.DocumentHandler handler, java.io.Writer out)Creates a new DebugHandler which forwards events to the given document handler.- Parameters:
handler- the DocumentHandler to forward events toout- the Writer to print debug information to
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionProxies 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:
charactersin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionProxies the org.sax.xml.DocumentHandler#endDocument() request to the proxy that is provided, printing debugging information before doing the proxy.- Specified by:
endDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String name) throws org.xml.sax.SAXExceptionProxies the org.sax.xml.DocumentHandler#endElement(String) request to the proxy that is provided, printing debugging information before doing the proxy.- Specified by:
endElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionProxies 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:
ignorableWhitespacein interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXExceptionProxies the org.sax.xml.DocumentHandler#processingInstruction(String, String) request to the proxy that is provided, printing debugging information before doing the proxy.- Specified by:
processingInstructionin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.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:
setDocumentLocatorin interfaceorg.xml.sax.DocumentHandler
-
startDocument
public void startDocument() throws org.xml.sax.SAXExceptionProxies the org.sax.xml.DocumentHandler#startDocument() request to the proxy that is provided, printing debugging information before doing the proxy.- Specified by:
startDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXExceptionProxies the org.sax.xml.DocumentHandler#startElement(String, AttributeList) request to the proxy that is provided, printing debugging information before doing the proxy.- Specified by:
startElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
-