com.northconcepts.datapipeline.fixedwidth
Class FixedWidthReader

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataReader
          extended by com.northconcepts.datapipeline.core.AbstractReader
              extended by com.northconcepts.datapipeline.core.TextReader
                  extended by com.northconcepts.datapipeline.fixedwidth.FixedWidthReader

public class FixedWidthReader
extends TextReader

Obtains records from a fixed width stream.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State
 
Field Summary
 
Fields inherited from class com.northconcepts.datapipeline.core.TextReader
EOF, reader
 
Fields inherited from class com.northconcepts.datapipeline.core.AbstractReader
currentRecord, fieldNames, lastRow, startingRow
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
FixedWidthReader(File file)
           
FixedWidthReader(Reader reader)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 FixedWidthReader addField(String name, int width)
           
 FixedWidthReader addFields(int... width)
           
protected  boolean fillRecord(Record record)
           
 char getFillChar()
           
 void open()
          Makes this endpoint ready for reading or writing.
 FixedWidthReader setFillChar(char fillChar)
           
 FixedWidthReader skipField(int width)
           
 
Methods inherited from class com.northconcepts.datapipeline.core.TextReader
available, close, readImpl
 
Methods inherited from class com.northconcepts.datapipeline.core.AbstractReader
getFieldNames, getLastRow, getStartingRow, isFieldNamesInFirstRow, read, setFieldNames, setFieldNamesInFirstRow, setLastRow, setStartingRow
 
Methods inherited from class com.northconcepts.datapipeline.core.DataReader
getBufferSize, getNestedReader, getRootReader, peek, pop, push, skip
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedWidthReader

public FixedWidthReader(File file)

FixedWidthReader

public FixedWidthReader(Reader reader)
Method Detail

getFillChar

public char getFillChar()

setFillChar

public FixedWidthReader setFillChar(char fillChar)

addFields

public FixedWidthReader addFields(int... width)

addField

public FixedWidthReader addField(String name,
                                 int width)

skipField

public FixedWidthReader skipField(int width)

addExceptionProperties

public DataException addExceptionProperties(DataException exception)
Description copied from class: DataEndpoint
Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.

Overrides:
addExceptionProperties in class TextReader

open

public void open()
          throws DataException
Description copied from class: DataEndpoint
Makes this endpoint ready for reading or writing.

Overrides:
open in class TextReader
Throws:
DataException

fillRecord

protected boolean fillRecord(Record record)
                      throws Throwable
Specified by:
fillRecord in class AbstractReader
Throws:
Throwable


Copyright (c) 2007-2009 North Concepts Inc. All Rights Reserved.