net.sf.joost.trace
Class DebugEmitter

java.lang.Object
  extended by net.sf.joost.stx.Emitter
      extended by net.sf.joost.trace.DebugEmitter
All Implemented Interfaces:
Constants

public class DebugEmitter
extends Emitter

Extends the Emitter with debug features.

Version:
$Revision: 1.12 $ $Date: 2006/02/03 19:04:46 $
Author:
Zubow

Nested Class Summary
 class DebugEmitter.DebugWriter
           
 
Field Summary
private  LocatorImpl locator
          handle locator information
private static org.apache.commons.logging.Log log
          logger
private  TraceManager tmgr
          for dynamic tracing
 DebugEmitter.DebugWriter writer
           
 
Fields inherited from class net.sf.joost.stx.Emitter
contH, prev
 
Fields inherited from interface net.sf.joost.Constants
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS
 
Constructor Summary
private DebugEmitter(DebugEmitter prev, StxEmitter handler)
          Called from pushEmitter(StxEmitter)
  DebugEmitter(ErrorHandlerImpl errorHandler)
          constructor see Emitter.Emitter(ErrorHandlerImpl)
 
Method Summary
 void characters(char[] ch, int start, int length, NodeBase instruction)
          overloaded method for debug information
 void comment(char[] ch, int start, int length, NodeBase instruction)
          overloaded method for debug information
 void endCDATA()
          overloaded method for debug information
 void endDocument(AbstractInstruction instruction)
          overloaded method for debug information
 void endElement(String uri, String lName, String qName, AbstractInstruction instruction)
          overloaded method for debug information
 Locator getEmitterLocator()
           
 Writer getResultWriter(String href, String encoding, String publicId, String systemId, int lineNo, int colNo, boolean append)
          overloaded method for debug support see Emitter.getResultWriter(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, boolean)
 TraceManager getTraceManager()
          getter for tmgr property
 void processingInstruction(String target, String data, NodeBase instruction)
          overloaded method for debug information
 Emitter pushEmitter(StxEmitter handler)
          Put the current emitter object on a stack and return a new emitter, which uses the given handler.
 void setTraceManager(TraceManager tmgr)
          setter for tmgr property
 void startCDATA(NodeBase instruction)
          overloaded method for debug information
 void startDocument()
          overloaded method for debug information
 void startElement(String uri, String lName, String qName, Attributes attrs, Hashtable namespaces, NodeBase instruction)
          overloaded method for debug information
private  void updateLocator(String publicId, String systemId, int lineNo, int colNo)
           
 
Methods inherited from class net.sf.joost.stx.Emitter
addAttribute, createDTD, isEmitterActive, setContentHandler, setLexicalHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
logger


tmgr

private TraceManager tmgr
for dynamic tracing


locator

private LocatorImpl locator
handle locator information


writer

public DebugEmitter.DebugWriter writer
Constructor Detail

DebugEmitter

public DebugEmitter(ErrorHandlerImpl errorHandler)
constructor see Emitter.Emitter(ErrorHandlerImpl)


DebugEmitter

private DebugEmitter(DebugEmitter prev,
                     StxEmitter handler)
Called from pushEmitter(StxEmitter)

Parameters:
prev - the previous emitter
handler - the new content handler
Method Detail

pushEmitter

public Emitter pushEmitter(StxEmitter handler)
Description copied from class: Emitter
Put the current emitter object on a stack and return a new emitter, which uses the given handler. This method may be overridden.

Overrides:
pushEmitter in class Emitter
Parameters:
handler - the STX handler for the new emitter
Returns:
a new emitter object

setTraceManager

public void setTraceManager(TraceManager tmgr)
setter for tmgr property


getTraceManager

public TraceManager getTraceManager()
getter for tmgr property


getEmitterLocator

public Locator getEmitterLocator()

getResultWriter

public Writer getResultWriter(String href,
                              String encoding,
                              String publicId,
                              String systemId,
                              int lineNo,
                              int colNo,
                              boolean append)
                       throws IOException,
                              SAXException
overloaded method for debug support see Emitter.getResultWriter(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, boolean)

Overrides:
getResultWriter in class Emitter
Parameters:
href - the filename
encoding - the requested encoding
publicId - public ID of the transformation sheet
systemId - system ID of the transformation sheet
lineNo - line number of the stx:result-document instruction
colNo - column number of the stx:result-document instruction
append - flag that determines, whether the new XML should be appended to an existing file
Throws:
IOException
SAXException

startDocument

public void startDocument()
                   throws SAXException
overloaded method for debug information

Overrides:
startDocument in class Emitter
Throws:
SAXException

endDocument

public void endDocument(AbstractInstruction instruction)
                 throws SAXException
overloaded method for debug information

Overrides:
endDocument in class Emitter
Parameters:
instruction - the instruction that causes this method invocation
Throws:
SAXException

startElement

public void startElement(String uri,
                         String lName,
                         String qName,
                         Attributes attrs,
                         Hashtable namespaces,
                         NodeBase instruction)
                  throws SAXException
overloaded method for debug information

Overrides:
startElement in class Emitter
instruction - the instruction that causes this method invocation
Throws:
SAXException

endElement

public void endElement(String uri,
                       String lName,
                       String qName,
                       AbstractInstruction instruction)
                throws SAXException
overloaded method for debug information

Overrides:
endElement in class Emitter
instruction - the instruction that causes this method invocation
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length,
                       NodeBase instruction)
                throws SAXException
overloaded method for debug information

Overrides:
characters in class Emitter
instruction - the instruction that causes this method invocation
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data,
                                  NodeBase instruction)
                           throws SAXException
overloaded method for debug information

Overrides:
processingInstruction in class Emitter
instruction - the instruction that causes this method invocation
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length,
                    NodeBase instruction)
             throws SAXException
overloaded method for debug information

Overrides:
comment in class Emitter
instruction - the instruction that causes this method invocation
Throws:
SAXException

startCDATA

public void startCDATA(NodeBase instruction)
                throws SAXException
overloaded method for debug information

Overrides:
startCDATA in class Emitter
Parameters:
instruction - the instruction that causes this method invocation
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
overloaded method for debug information

Overrides:
endCDATA in class Emitter
Throws:
SAXException

updateLocator

private void updateLocator(String publicId,
                           String systemId,
                           int lineNo,
                           int colNo)