INRIA & FluxMedia

fr.fluxmedia.tmcontrib.external
Class Log

java.lang.Object
  extended by fr.fluxmedia.transmorpher.engine.TProcess_Impl
      extended by fr.fluxmedia.transmorpher.engine.TProcessBasic
          extended by fr.fluxmedia.tmcontrib.external.Log
All Implemented Interfaces:
TApplyExternal, TProcess, java.lang.Runnable, org.xml.sax.ContentHandler

public class Log
extends TProcessBasic
implements TApplyExternal, org.xml.sax.ContentHandler

The main goal of this class is debugging. A log component can be add in a SAX events flow in order to print these events in a file.

Author:
triolet

Field Summary
protected  java.lang.String fileName
          Description of the Field
(package private)  org.xml.sax.ContentHandler inHandler
           
private  java.io.FileWriter logfile
           
(package private)  org.xml.sax.ContentHandler outHandler
           
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcessBasic
finished, isThread, param, procThread, type
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
debug, id, iListIn, iListOut, iNbIn, iNbOut, nameFather, nameIn, nameOut
 
Constructor Summary
Log(java.lang.String[] pIn, java.lang.String[] pOut, Parameters params, StringParameters staticParams)
          Constructor for the Log object
 
Method Summary
 void characters(char[] ch, int start, int length)
          the characters method of content handler interface
 void endDocument()
          the endDocument method of content handler interface
 void endElement(java.lang.String ns, java.lang.String localName, java.lang.String name)
          the endElement method of content handler interface
 void endPrefixMapping(java.lang.String prefix)
          the endPrefixMapping method of content handler interface
 void generatePort()
          Description of the Method
 void ignorableWhitespace(char[] ch, int start, int length)
          the ignorableWhitespace method of content handler interface
private  void printLog(java.lang.String method, java.lang.String content)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
          the processingInstruction method of content handler interface
 void setContentHandler(org.xml.sax.ContentHandler handler)
          Sets the contentHandler attribute of the Log object
 void setDocumentLocator(org.xml.sax.Locator locator)
          the setDocumentLocator method of content handler interface
 void skippedEntity(java.lang.String name)
          the skippedEntity method of content handler interface
 void startDocument()
          the startDocument method of content handler interface
 void startElement(java.lang.String ns, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
          the start element method of content handler interface
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          the startPrefixMapping method of content handler interface
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcessBasic
execProcess, getFinished, getType, initParameters, run, setFinished, setThread, setType
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
bindParameters, getFatherName, getId, getIn, getIn, getIn, getName, getNameIn, getNameIn, getNameOut, getNameOut, getOut, getOut, getOut, getParameter, getParameterNames, getParameters, reset, setDebug, setFatherName, setId, setIn, setName, setOut, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.fluxmedia.transmorpher.engine.TProcess
bindParameters, getFatherName, getIn, getIn, getIn, getName, getNameIn, getNameIn, getNameOut, getNameOut, getOut, getOut, getOut, getParameter, getParameters, reset, setDebug, setFatherName, setIn, setName, setOut, setParameter, setParameters
 

Field Detail

outHandler

org.xml.sax.ContentHandler outHandler

inHandler

org.xml.sax.ContentHandler inHandler

fileName

protected java.lang.String fileName
Description of the Field


logfile

private java.io.FileWriter logfile
Constructor Detail

Log

public Log(java.lang.String[] pIn,
           java.lang.String[] pOut,
           Parameters params,
           StringParameters staticParams)
    throws org.xml.sax.SAXException,
           java.io.IOException
Constructor for the Log object

Parameters:
pIn - Description of the Parameter
pOut - Description of the Parameter
params - Description of the Parameter
staticParams - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception
java.io.IOException - Description of the Exception
Method Detail

generatePort

public void generatePort()
Description of the Method

Specified by:
generatePort in interface TProcess
Specified by:
generatePort in class TProcess_Impl

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler handler)
Sets the contentHandler attribute of the Log object

Specified by:
setContentHandler in interface TApplyExternal
Parameters:
handler - The new contentHandler value

startElement

public final void startElement(java.lang.String ns,
                               java.lang.String localName,
                               java.lang.String name,
                               org.xml.sax.Attributes atts)
                        throws org.xml.sax.SAXException
the start element method of content handler interface

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
ns - Description of the Parameter
localName - Description of the Parameter
name - Description of the Parameter
atts - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

endElement

public final void endElement(java.lang.String ns,
                             java.lang.String localName,
                             java.lang.String name)
                      throws org.xml.sax.SAXException
the endElement method of content handler interface

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
ns - Description of the Parameter
localName - Description of the Parameter
name - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

setDocumentLocator

public final void setDocumentLocator(org.xml.sax.Locator locator)
the setDocumentLocator method of content handler interface

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Parameters:
locator - The new documentLocator value

startDocument

public final void startDocument()
                         throws org.xml.sax.SAXException
the startDocument method of content handler interface

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Description of the Exception

endDocument

public final void endDocument()
                       throws org.xml.sax.SAXException
the endDocument method of content handler interface

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Description of the Exception

skippedEntity

public final void skippedEntity(java.lang.String name)
                         throws org.xml.sax.SAXException
the skippedEntity method of content handler interface

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Parameters:
name - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

processingInstruction

public final void processingInstruction(java.lang.String target,
                                        java.lang.String data)
                                 throws org.xml.sax.SAXException
the processingInstruction method of content handler interface

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Parameters:
target - Description of the Parameter
data - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

ignorableWhitespace

public final void ignorableWhitespace(char[] ch,
                                      int start,
                                      int length)
                               throws org.xml.sax.SAXException
the ignorableWhitespace method of content handler interface

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
ch - Description of the Parameter
start - Description of the Parameter
length - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

characters

public final void characters(char[] ch,
                             int start,
                             int length)
                      throws org.xml.sax.SAXException
the characters method of content handler interface

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - Description of the Parameter
start - Description of the Parameter
length - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

startPrefixMapping

public final void startPrefixMapping(java.lang.String prefix,
                                     java.lang.String uri)
                              throws org.xml.sax.SAXException
the startPrefixMapping method of content handler interface

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - Description of the Parameter
uri - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

endPrefixMapping

public final void endPrefixMapping(java.lang.String prefix)
                            throws org.xml.sax.SAXException
the endPrefixMapping method of content handler interface

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - Description of the Parameter
Throws:
org.xml.sax.SAXException - Description of the Exception

printLog

private void printLog(java.lang.String method,
                      java.lang.String content)
Parameters:
method - Description of the Parameter
content - Description of the Parameter

INRIA & FluxMedia

..no bottom yet...