INRIA & FluxMedia

fr.fluxmedia.transmorpher.engine
Class TestHandler

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

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, registerNatives, 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
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
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
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
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
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
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
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
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
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
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
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
Following copied from class: fr.fluxmedia.transmorpher.engine.BufferingHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.

INRIA & FluxMedia

..no bottom yet...