net.sf.filePiper.model
Class OneToOneTextFileProcessor

java.lang.Object
  extended by net.sf.filePiper.model.OneToOneByteFileProcessor
      extended by net.sf.filePiper.model.OneToOneTextFileProcessor
All Implemented Interfaces:
FileProcessor
Direct Known Subclasses:
BreakLinesProcessor, ReplaceProcessor

public abstract class OneToOneTextFileProcessor
extends OneToOneByteFileProcessor

Base implementation for FileProcessor with ONE to ONE cardinality and processing text streams.
The original streams are converted to BufferedReader and BufferedWriter to allow to read and write text easily. There is only 3 remaining abstract methods very simple to implement.

Author:
BEROL

Field Summary
 
Fields inherited from interface net.sf.filePiper.model.FileProcessor
MANY, NONE, ONE
 
Constructor Summary
OneToOneTextFileProcessor()
           
 
Method Summary
abstract  void process(BufferedReader in, BufferedWriter out, FileProcessorEnvironment env)
           
 void process(InputStream is, InputFileInfo info, FileProcessorEnvironment env)
          Request to process the given input stream.
 void process(InputStream is, OutputStream os, FileProcessorEnvironment env)
           
 
Methods inherited from class net.sf.filePiper.model.OneToOneByteFileProcessor
bytesProcessed, endBatch, getCurrentInputFileInfo, getEditor, getOutputCardinality, getProcessorDescription, getProcessorName, getProposedExtension, getProposedNameSuffix, getSettings, getStatusMessage, init, inputFileStarted, linesProcessed, setCurrentInputFileInfo, setProposedFilePath, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneToOneTextFileProcessor

public OneToOneTextFileProcessor()
Method Detail

process

public void process(InputStream is,
                    InputFileInfo info,
                    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
Overrides:
process in class OneToOneByteFileProcessor
Parameters:
is - the InputStream to process
info - Information about the input file to process
env - object used by this FileProcessor to interact with its environment.
Throws:
IOException - if something goes wrong.

process

public void process(InputStream is,
                    OutputStream os,
                    FileProcessorEnvironment env)
             throws Exception
Specified by:
process in class OneToOneByteFileProcessor
Throws:
Exception

process

public abstract void process(BufferedReader in,
                             BufferedWriter out,
                             FileProcessorEnvironment env)
                      throws Exception
Throws:
Exception


Copyright © 2011. All Rights Reserved.