org.jmonks.batch.io.flat
Class DelimitedFlatFileReader

java.lang.Object
  extended byorg.jmonks.batch.io.FileReader
      extended byorg.jmonks.batch.io.flat.FlatFileReader
          extended byorg.jmonks.batch.io.flat.DelimitedFlatFileReader

public class DelimitedFlatFileReader
extends FlatFileReader

DelimitedFlatFileReader reads the specified delimited flat file according to the given file spec and returns the recrods on the needed basis. Each field value from the record should be read using readField method by passing the fieldName mentioned in the file spec. To find out how to read each record from the file and to read the each field from the record, refer to the FileReader javadoc.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Nested Class Summary
 
Nested classes inherited from class org.jmonks.batch.io.flat.FlatFileReader
FlatFileReader.FlatFileReaderRecord
 
Field Summary
 
Fields inherited from class org.jmonks.batch.io.flat.FlatFileReader
fileSpec
 
Constructor Summary
DelimitedFlatFileReader(java.io.InputStream fileInputStream, FileSpec fileSpec)
          Constructs the Delimited flat file reader from the given input stream and file spec.
DelimitedFlatFileReader(java.io.Reader reader, FileSpec fileSpec)
          Constructs the Delimited flat file reader from the given input stream and file spec.
 
Method Summary
protected  ReaderRecord parseRecord(java.lang.String recordString)
          Parses the given record string where fields are delimited by a special character and returns the reader record.
 
Methods inherited from class org.jmonks.batch.io.flat.FlatFileReader
close, getNextRecord
 
Methods inherited from class org.jmonks.batch.io.FileReader
getFileReader, getFileReader, getFileReader, getFileReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedFlatFileReader

public DelimitedFlatFileReader(java.io.InputStream fileInputStream,
                               FileSpec fileSpec)
Constructs the Delimited flat file reader from the given input stream and file spec.

Parameters:
fileInputStream - Input stream representing the file to parse.
fileSpec - File spec of the delimited flat to be read.

DelimitedFlatFileReader

public DelimitedFlatFileReader(java.io.Reader reader,
                               FileSpec fileSpec)
Constructs the Delimited flat file reader from the given input stream and file spec.

Parameters:
reader - Reader representing the file to parse.
fileSpec - File spec of the delimited flat to be read.
Method Detail

parseRecord

protected ReaderRecord parseRecord(java.lang.String recordString)
Parses the given record string where fields are delimited by a special character and returns the reader record.

Specified by:
parseRecord in class FlatFileReader
Parameters:
recordString - Record consists of fields delimited by special character.