net.sf.filePiper.processors
Class NoOutputProcessor

java.lang.Object
  extended by net.sf.filePiper.processors.NoOutputProcessor
All Implemented Interfaces:
FileProcessor

public class NoOutputProcessor
extends Object
implements FileProcessor

Processor doing nothing with the input file and creating no ouput.

Author:
BEROL

Field Summary
 
Fields inherited from interface net.sf.filePiper.model.FileProcessor
MANY, NONE, ONE
 
Constructor Summary
NoOutputProcessor()
           
 
Method Summary
 void endBatch(FileProcessorEnvironment env)
          Notification that the current batch is finished.
 net.sf.sfac.gui.editor.ObjectEditor getEditor()
          Get a GUI editor for this object.
 int getInputCardinality()
           
 int getOutputCardinality(int inputCardinality)
          Get the number of output streams generated for the given number of input streams.
 String getProcessorName()
           
 String getStatusMessage()
          Get the status of this processor to display in the status bar of the GUI during file processing.
 void init(net.sf.sfac.setting.Settings sett)
          Initialize this file processor just after instantiation (called only once).
 void process(InputStream is, InputFileInfo line, FileProcessorEnvironment env)
          Request to process the given input stream.
 void startBatch(FileProcessorEnvironment env)
          Notification that the processing of a batch of file is starting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOutputProcessor

public NoOutputProcessor()
Method Detail

getProcessorName

public String getProcessorName()
Specified by:
getProcessorName in interface FileProcessor
Returns:
A displayable name for this processor.

init

public void init(net.sf.sfac.setting.Settings sett)
Description copied from interface: FileProcessor
Initialize this file processor just after instantiation (called only once).
The settings passed here should be use to store all persistent data.

Specified by:
init in interface FileProcessor
Parameters:
sett - Settings for this FileProcessor instance.

getInputCardinality

public int getInputCardinality()

getOutputCardinality

public int getOutputCardinality(int inputCardinality)
Description copied from interface: FileProcessor
Get the number of output streams generated for the given number of input streams.
possible values are:

Specified by:
getOutputCardinality in interface FileProcessor
Parameters:
inputCardinality - ONE or MANY.

process

public void process(InputStream is,
                    InputFileInfo line,
                    FileProcessorEnvironment env)
             throws IOException
Description copied from interface: FileProcessor
Request to process the given input stream.
The output stream to use for output should be requested to the FileProcessorEnvironment.

Specified by:
process in interface FileProcessor
Parameters:
is - the InputStream to process
line - Information about the input file to process
env - object used by this FileProcessor to interact with its environment.
Throws:
IOException - if something goes wrong.

startBatch

public void startBatch(FileProcessorEnvironment env)
Description copied from interface: FileProcessor
Notification that the processing of a batch of file is starting.
This method allows to initialize this FileProcessor before each file batch processing.

Specified by:
startBatch in interface FileProcessor

endBatch

public void endBatch(FileProcessorEnvironment env)
Description copied from interface: FileProcessor
Notification that the current batch is finished.

Specified by:
endBatch in interface FileProcessor

getStatusMessage

public String getStatusMessage()
Description copied from interface: FileProcessor
Get the status of this processor to display in the status bar of the GUI during file processing.

Warning: this method is called in a different Thread from the processing Thread (the Thread calling the process(..) method). It is usually called from the swing EventDispatchThread. So, be aware of possible threading synchronization problems while accessing the instance variables of your class.

Specified by:
getStatusMessage in interface FileProcessor
Returns:
the status of this processor.

getEditor

public net.sf.sfac.gui.editor.ObjectEditor getEditor()
Description copied from interface: FileProcessor
Get a GUI editor for this object.

Specified by:
getEditor in interface FileProcessor


Copyright © 2011. All Rights Reserved.