INRIA & FluxMedia

fr.fluxmedia.transmorpher.engine
Class TestHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by fr.fluxmedia.transmorpher.engine.BufferingHandler
          extended by fr.fluxmedia.transmorpher.engine.LoopHandler
              extended by fr.fluxmedia.transmorpher.engine.TestHandler
All Implemented Interfaces:
TmHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

 class TestHandler
extends LoopHandler

Implements the SAX events circulation and buffering in a loop-channel LoopHandler is the handler of a Loop channel. It is a BufferingHandler in two respects: - it takes a buffer of its output (which can be flushed either to the process or to the out); - it takes a buffer of its previous input for the purpose of comparison); NEED A LIFO

Author:
jerome.euzenat@inrialpes.fr
See Also:
"SAX 2.0 & JDK 1.3"

Field Summary
(package private)  boolean diff
          true if the wStack and iStack have been found different (Test)
(package private)  boolean isInit
          true if the wStack and iStack have been found different (Test)
(package private)  Fifo wStack
          The witness stack
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.LoopHandler
isDone, outhdl, processHandler
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.BufferingHandler
isCurrent, iStack, outputHandler
 
Constructor Summary
TestHandler()
          the constructor
 
Method Summary
 void characters(char[] ch, int start, int length)
          The characters command
 void endDocument()
          The endDocument command
 void endElement(java.lang.String ns, java.lang.String localName, java.lang.String name)
          The endElement command
 void endLoop()
          endLoop() is called by the calling process after the last loop for flushing the channel out of the repeat process
 void endPrefixMapping(java.lang.String prefix)
          The endPrefixMapping command
 void flushBuffer()
          Compute the stack of contentHandlerInfo .
 void ignorableWhitespace(char[] ch, int start, int length)
          The ignorableWhitespace command
 boolean isDiff()
          isDiff() is called by the calling process after each Loop for knowing if the input and output of the channel are different or not
 void newLoop()
          newLoop() is called by the associated LoopHandler for signifying that it has processed previous document and is ready to get a new one (unfortunately, this should be triggered by the calling process at each loop
 void processingInstruction(java.lang.String target, java.lang.String data)
          The processingInstruction command
 void setDocumentLocator(org.xml.sax.Locator locator)
          The setDocumentLocator command
 void skippedEntity(java.lang.String name)
          The skippedEntity command
 void startDocument()
          The startDocument command
 void startElement(java.lang.String ns, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
          The startElement command
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          The startPrefixMapping command
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.LoopHandler
initLoop, setInnerHandler, setOutputHandler
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.BufferingHandler
add, isCurrent, isDone, pop, setCurrent, setDone, size
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wStack

Fifo wStack
The witness stack


diff

boolean diff
true if the wStack and iStack have been found different (Test)


isInit

boolean isInit
true if the wStack and iStack have been found different (Test)

Constructor Detail

TestHandler

public TestHandler()
the constructor

Method Detail

newLoop

public void newLoop()
             throws org.xml.sax.SAXException
newLoop() is called by the associated LoopHandler for signifying that it has processed previous document and is ready to get a new one (unfortunately, this should be triggered by the calling process at each loop

Overrides:
newLoop in class LoopHandler
Throws:
org.xml.sax.SAXException - Description of the Exception

endLoop

public void endLoop()
             throws org.xml.sax.SAXException
endLoop() is called by the calling process after the last loop for flushing the channel out of the repeat process

Overrides:
endLoop in class LoopHandler
Throws:
org.xml.sax.SAXException - Description of the Exception

isDiff

public boolean isDiff()
isDiff() is called by the calling process after each Loop for knowing if the input and output of the channel are different or not

Returns:
The diff value

startElement

public 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 startElement command

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class BufferingHandler
Parameters:
ns - The Namespace URI.
localName - The local name without prefix.
name - The local name with prefix.
atts - The attributes attached to the element.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endElement

public void endElement(java.lang.String ns,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
The endElement command

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class BufferingHandler
Parameters:
ns - The Namespace URI.
localName - The local name without prefix.
name - The local name with prefix.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
The startDocument command

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class BufferingHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
The endDocument command

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class BufferingHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
The setDocumentLocator command

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class BufferingHandler
Parameters:
locator - An object that can return the location of any SAX document event.

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
The skippedEntity command

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Overrides:
skippedEntity in class BufferingHandler
Parameters:
name - The name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]".
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
The processingInstruction command

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class BufferingHandler
Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
The ignorableWhitespace command

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Overrides:
ignorableWhitespace in class BufferingHandler
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
The characters command

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class BufferingHandler
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
The startPrefixMapping command

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class BufferingHandler
Parameters:
prefix - The prefix that was being mapping.
uri - The Namespace URI the prefix is mapped to.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
The endPrefixMapping command

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class BufferingHandler
Parameters:
prefix - The prefix that was being mapping.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

flushBuffer

public void flushBuffer()
                 throws org.xml.sax.SAXException
Compute the stack of contentHandlerInfo . Stack is not destroyed.

Overrides:
flushBuffer in class BufferingHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

INRIA & FluxMedia

..no bottom yet...