A reader to XML demux pipeline item is a demupltiplexer that takes a character stream as input and generates a sequence of streams of SAX events as output. In order to facilitate a custom transform of the character stream, the user has to specify in a JSR-223 compliant script, the implementation of the following functions:
public abstract void transformBuffer(char[] buffer, int offset, int length, ContentHandler contentHandler); public abstract boolean shouldChangePipeline();
The transformBuffer()
method will be called each time a buffer is read
in order for the script implementation to transform it as needed. The implementor of this method is
supposed to generate appropriate content handler calls to create the SAX events that
will generate the XML for the transformation of the incoming character stream. The additional
shouldChangePipeline
method should return true, when
the boundaries of one result stream has been reached and another should be started.
The transformBuffer()
method is going to be called with a length
parameter of -1
when the end of the input stream is reached.