| java.lang.Object java.io.Writer simple.page.translate.Processor
Processor | final class Processor extends Writer (Code) | | The Processor object is used to process a stream of
characters from a JSP source file. This performs the building
process for the translator in a simple stream based manner, such
a process allows translators to cascade, such that multiple
syntaxes can be present in a single JSP source file.
author: Niall Gallagher See Also: simple.page.translate.Translator |
Method Summary | |
public void | close() Once the JSP source has been written the processor must be closed
so that the lexer can perform a final emit of tokens to the
parse. | public void | flush() This method is used to flush any buffered data to the lexer. | public void | prepare(Parser parser) Each parses can dynamically specify its own token types. | public void | write(char[] text) This is used to write a character buffer to the lexer. | public void | write(char[] text, int off, int len) This is used to write a character buffer to the lexer. |
Processor | public Processor(Definition source, Builder builder)(Code) | | Constructor for the Processor object. This takes
the builder used to construct the document definition and the
document definition that accumulates the code segments.
Parameters: source - this is the document definition to populate Parameters: builder - this is the builder used to build the source |
close | public void close()(Code) | | Once the JSP source has been written the processor must be closed
so that the lexer can perform a final emit of tokens to the
parse. If the close method is not invoked some JSP source may not
be flushed to the lexer, and thus may result in an incomplete JSP.
|
flush | public void flush()(Code) | | This method is used to flush any buffered data to the lexer. The
current implementation of this method exists to fulfil the
super class abstract method, as characters are not buffered here.
|
prepare | public void prepare(Parser parser)(Code) | | Each parses can dynamically specify its own token types. This
enables it to digest the tokens emitted from lexical analysis.
Once this has been invoked the lexer is ready to receve the
soure for the JSP file.
Parameters: parser - this is the parser used to digest the tokens |
write | public void write(char[] text)(Code) | | This is used to write a character buffer to the lexer. The data
written to the lexer is analysed and used to emit tokens to
the parse. The will delegate to the append method.
Parameters: text - this is some source text from the JSP file |
write | public void write(char[] text, int off, int len)(Code) | | This is used to write a character buffer to the lexer. The data
written to the lexer is analysed and used to emit tokens to
the parse. The will delegate to the append method.
Parameters: text - this is some source text from the JSP file Parameters: off - this is the offset within the text to read from Parameters: len - this is the number of characters to consider |
|
|