net.sf.joost.trace
Class DebugProcessor

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by net.sf.joost.stx.Processor
          extended by net.sf.joost.trace.DebugProcessor
All Implemented Interfaces:
Constants, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader

public class DebugProcessor
extends Processor

Extends the Processor with debug features.

Version:
$Revision: 1.22 $ $Date: 2008/10/04 17:13:14 $
Author:
Zubow

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.joost.stx.Processor
Processor.Data, Processor.DataStack
 
Field Summary
private  Locator locator
           
private static org.apache.commons.logging.Log log
          logger
private  ParserListener parserListener
          the ParserListener for static tracing
private  TraceManager tmgr
          the TraceManager for dynamic tracing
private  TransformerImpl transformer
          the TrAX-Transformer
 
Fields inherited from class net.sf.joost.stx.Processor
outputProperties, PASS_THROUGH_ALL, PASS_THROUGH_ATTRIBUTE, PASS_THROUGH_COMMENT, PASS_THROUGH_ELEMENT, PASS_THROUGH_NONE, PASS_THROUGH_PI, PASS_THROUGH_TEXT
 
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
DebugProcessor(InputSource src, ParseContext pContext)
          See Processor.Processor(org.xml.sax.InputSource, ParseContext)
DebugProcessor(Parser stxParser)
          See Processor.Processor(net.sf.joost.stx.Parser)
DebugProcessor(Processor proc)
          See Processor.Processor(net.sf.joost.stx.Processor)
DebugProcessor(XMLReader reader, InputSource src, ParseContext pContext)
          See Processor.Processor(XMLReader, InputSource, ParseContext)
DebugProcessor(XMLReader reader, InputSource src, ParseContext pContext, StxEmitter messageEmitter)
          See Processor.Processor(XMLReader, InputSource, ParseContext)
 
Method Summary
 void characters(char[] ch, int start, int length)
          overloaded method of ContentHandler for debug information
 void comment(char[] ch, int start, int length)
          overloaded method of LexicalHandler for debug information
 Processor copy()
          See Processor.copy()
 void endDocument()
          overloaded method of ContentHandler for debug information
 void endElement(String uri, String lName, String qName)
          overloaded method of ContentHandler for debug information
 Locator getDocumentLocator()
           
 ParserListener getParserListener()
          getter for property parserListener
 TraceManager getTraceManager()
          getter for property tmgr
 TransformerImpl getTransformer()
          getter for property transformer
protected  Emitter initializeEmitter(Context ctx)
          Overriden method for debug purpose
 void processingInstruction(String target, String data)
          overloaded method of ContentHandler for debug information
protected  int processInstruction(AbstractInstruction inst, SAXEvent event)
          Overriden method for the execution of a given instruction.
 void setDocumentLocator(Locator locator)
          Store the locator in the context object
 void setTraceManager(TraceManager tmgr)
          setter for property tmgr
 void setTransformer(TransformerImpl transformer)
          setter for property transformer
 void startDocument()
          overloaded method of ContentHandler for debug information
 void startElement(String uri, String lName, String qName, Attributes attrs)
          overloaded method of ContentHandler for debug information
 void startPrefixMapping(String prefix, String uri)
          overloaded method of ContentHandler for debug information
 
Methods inherited from class net.sf.joost.stx.Processor
clearParameters, createXMLReader, endCDATA, endDTD, endEntity, endInnerProcessing, endPrefixMapping, getContext, getDataStack, getEmitter, getEventStack, getLastElement, getOutputEncoding, getParameter, ignorableWhitespace, initOutputProperties, setContentHandler, setDeclHandler, setErrorListener, setLexicalHandler, setMessageEmitter, setOutputURIResolver, setParameter, setParent, setProperty, setTransformerHandlerResolver, setURIResolver, startCDATA, startDTD, startEntity, startInnerProcessing
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, parse, resolveEntity, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, skippedEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tmgr

private TraceManager tmgr
the TraceManager for dynamic tracing


transformer

private TransformerImpl transformer
the TrAX-Transformer


parserListener

private ParserListener parserListener
the ParserListener for static tracing


locator

private Locator locator

log

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

Constructor Detail

DebugProcessor

public DebugProcessor(Processor proc)
               throws SAXException
See Processor.Processor(net.sf.joost.stx.Processor)

Throws:
SAXException

DebugProcessor

public DebugProcessor(Parser stxParser)
               throws SAXException
See Processor.Processor(net.sf.joost.stx.Parser)

Throws:
SAXException

DebugProcessor

public DebugProcessor(InputSource src,
                      ParseContext pContext)
               throws IOException,
                      SAXException
See Processor.Processor(org.xml.sax.InputSource, ParseContext)

Throws:
IOException
SAXException

DebugProcessor

public DebugProcessor(XMLReader reader,
                      InputSource src,
                      ParseContext pContext,
                      StxEmitter messageEmitter)
               throws IOException,
                      SAXException
See Processor.Processor(XMLReader, InputSource, ParseContext)

Throws:
IOException
SAXException

DebugProcessor

public DebugProcessor(XMLReader reader,
                      InputSource src,
                      ParseContext pContext)
               throws IOException,
                      SAXException
See Processor.Processor(XMLReader, InputSource, ParseContext)

Throws:
IOException
SAXException
Method Detail

copy

public Processor copy()
               throws SAXException
See Processor.copy()

Overrides:
copy in class Processor
Throws:
SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Description copied from class: Processor
Store the locator in the context object

Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class Processor

getDocumentLocator

public Locator getDocumentLocator()

initializeEmitter

protected Emitter initializeEmitter(Context ctx)
Overriden method for debug purpose

Overrides:
initializeEmitter in class Processor
Parameters:
ctx - The current context
Returns:
an emitter-instance

processInstruction

protected int processInstruction(AbstractInstruction inst,
                                 SAXEvent event)
                          throws SAXException
Overriden method for the execution of a given instruction.

Overrides:
processInstruction in class Processor
Parameters:
inst - the instruction to be executed
event - the current saxevent from source-document
Returns:
return codes, see Constants
Throws:
SAXException - in case of errors.

getParserListener

public ParserListener getParserListener()
getter for property parserListener


setTraceManager

public void setTraceManager(TraceManager tmgr)
setter for property tmgr


getTraceManager

public TraceManager getTraceManager()
getter for property tmgr


getTransformer

public TransformerImpl getTransformer()
getter for property transformer


setTransformer

public void setTransformer(TransformerImpl transformer)
setter for property transformer


startDocument

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

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class Processor
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
overloaded method of ContentHandler for debug information

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class Processor
Throws:
SAXException

startElement

public void startElement(String uri,
                         String lName,
                         String qName,
                         Attributes attrs)
                  throws SAXException
overloaded method of ContentHandler for debug information

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class Processor
Throws:
SAXException

endElement

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

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class Processor
Throws:
SAXException

characters

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

Specified by:
characters in interface ContentHandler
Overrides:
characters in class Processor
Throws:
SAXException

processingInstruction

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

Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class Processor
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
overloaded method of ContentHandler for debug information

Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class Processor
Throws:
SAXException

comment

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

Specified by:
comment in interface LexicalHandler
Overrides:
comment in class Processor
Throws:
SAXException