com.northconcepts.datapipeline.core
Class TextReader

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
Direct Known Subclasses:
CSVReader, FixedWidthReader

public abstract class TextReader
extends AbstractReader

Abstract super-class for obtaining records from a text stream.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State
 
Field Summary
protected static int EOF
           
protected  LineNumberReader 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
TextReader(File file)
           
TextReader(Reader reader)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 int available()
          Returns the number of records that can probably be read without blocking.
 void close()
          Indicates that this endpoint has finished reading or writing.
 void open()
          Makes this endpoint ready for reading or writing.
protected  Record readImpl()
          Overridden by subclasses to read the next record from this DataReader.
 
Methods inherited from class com.northconcepts.datapipeline.core.AbstractReader
fillRecord, 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
 

Field Detail

EOF

protected static final int EOF
See Also:
Constant Field Values

reader

protected final LineNumberReader reader
Constructor Detail

TextReader

public TextReader(File file)

TextReader

public TextReader(Reader reader)
Method Detail

available

public int available()
Description copied from class: DataReader
Returns the number of records that can probably be read without blocking.

Overrides:
available in class DataReader

open

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

Overrides:
open in class AbstractReader
Throws:
DataException

close

public void close()
Description copied from class: DataEndpoint
Indicates that this endpoint has finished reading or writing.

Overrides:
close in class DataEndpoint

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 AbstractReader

readImpl

protected Record readImpl()
                   throws Throwable
Description copied from class: DataReader
Overridden by subclasses to read the next record from this DataReader.

If no record is available, null will be returned.

Overrides:
readImpl in class AbstractReader
Throws:
Throwable


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