com.northconcepts.datapipeline.excel
Class ExcelReader

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.excel.ExcelReader

public class ExcelReader
extends AbstractReader

Obtains records from an excel document.


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.AbstractReader
currentRecord, fieldNames, lastRow, startingRow
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
ExcelReader(ExcelDocument document)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 void close()
          Indicates that this endpoint has finished reading or writing.
protected  boolean fillRecord(Record record)
           
 int getSheetIndex()
           
 String getSheetName()
           
 int getStartingColumn()
           
 boolean isEvaluateExpressions()
           
 boolean isUseSheetColumnCount()
           
 void open()
          Makes this endpoint ready for reading or writing.
 ExcelReader setEvaluateExpressions(boolean evaluateExpressions)
           
 ExcelReader setSheetIndex(int sheetIndex)
           
 ExcelReader setSheetName(String sheetName)
           
 ExcelReader setStartingColumn(int startingColumn)
           
 ExcelReader setUseSheetColumnCount(boolean useSheetColumnCount)
          Set whether to use the entire worksheet (or just the current row) when determining each record's field count.
 
Methods inherited from class com.northconcepts.datapipeline.core.AbstractReader
getFieldNames, getLastRow, getStartingRow, isFieldNamesInFirstRow, read, readImpl, setFieldNames, setFieldNamesInFirstRow, setLastRow, setStartingRow
 
Methods inherited from class com.northconcepts.datapipeline.core.DataReader
available, getBufferSize, getNestedReader, getRootReader, peek, pop, push, skip
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getDescription, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, setDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExcelReader

public ExcelReader(ExcelDocument document)
Method Detail

open

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

Overrides:
open in class AbstractReader

close

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

Overrides:
close in class DataEndpoint
Throws:
DataException

getSheetName

public String getSheetName()

setSheetName

public ExcelReader setSheetName(String sheetName)

getSheetIndex

public int getSheetIndex()

setSheetIndex

public ExcelReader setSheetIndex(int sheetIndex)

getStartingColumn

public int getStartingColumn()

setStartingColumn

public ExcelReader setStartingColumn(int startingColumn)

isEvaluateExpressions

public boolean isEvaluateExpressions()

setEvaluateExpressions

public ExcelReader setEvaluateExpressions(boolean evaluateExpressions)

isUseSheetColumnCount

public boolean isUseSheetColumnCount()

setUseSheetColumnCount

public ExcelReader setUseSheetColumnCount(boolean useSheetColumnCount)
Set whether to use the entire worksheet (or just the current row) when determining each record's field count. Default is false meaning each record may contain a different number of fields depending on the row.


fillRecord

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

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


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