sk.uniba.euromath.editor
Interface IInputPreprocessor


public interface IInputPreprocessor

Able to preprocess the input of renderer and editor. It receives live source instances.

First, process(IChangeCollector) is called, to process GENE's output. Method's output (or the original source if it was modified instead of cloned) will be then passed to renderer and editor. When source document is changed, the changes are undoed by calling the undo(IChangeCollector) method. This method is called ONLY if previous process(IChangeCollector) call returned null. Then, changes are applied to the source and process(IChangeCollector) is called again.

The preprocessor instances may be thread-unsafe - one instance of preprocessor will never be used to process two sources at once.

In case of DOMChangeCollector its source must not contain entities and CDATA nodes, and all adjacent text nodes must be merged together.

Author:
Martin Vysny

Method Summary
 void init(CoordinatorInputKey input)
          Initializes the preprocessor.
 IChangeCollector process(IChangeCollector source)
          Processes the source.
 void undo(IChangeCollector source)
          Undoes the changes made to the source by previous process(IChangeCollector) call.
 

Method Detail

init

void init(CoordinatorInputKey input)
Initializes the preprocessor.

Parameters:
input - the input descriptor.

process

IChangeCollector process(IChangeCollector source)
Processes the source.

Parameters:
source - the source instance to process.
Returns:
null if original source was modified, or a new source instance that will be passed to renderer and editor.

undo

void undo(IChangeCollector source)
Undoes the changes made to the source by previous process(IChangeCollector) call.

Parameters:
source - undo changes on this source.


Copyright © 2003-2006 null. All Rights Reserved.