com.northconcepts.datapipeline.core
Class AbstractWriter
java.lang.Object
com.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataWriter
com.northconcepts.datapipeline.core.AbstractWriter
- Direct Known Subclasses:
- BinaryWriter, ExcelWriter, TextWriter
public abstract class AbstractWriter
- extends DataWriter
Abstract super-class, with some common logic, for writing records. The only method subclasses must implement is writeRecord(Record).
| Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
assertNotOpened, assertOpened, close, decrementRecordCount, exception, exception, exception, finalize, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, toString |
currentRecord
protected Record currentRecord
AbstractWriter
public AbstractWriter()
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 DataWriter
setFieldNamesInFirstRow
public AbstractWriter setFieldNamesInFirstRow(boolean fieldNamesInFirstRow)
isFieldNamesInFirstRow
public boolean isFieldNamesInFirstRow()
open
public void open()
- Description copied from class:
DataEndpoint
- Makes this endpoint ready for reading or writing.
- Overrides:
open in class DataEndpoint
write
public void write(Record record)
throws DataException
- Description copied from class:
DataWriter
- Writes the specified record to this
DataWriter and increases the record-count by 1.
Any exception raised while writing will be converted to a DataException using DataEndpoint.exception(Throwable).
Subclasses generally do not need to override this method, instead they should implement DataWriter.writeImpl(Record).
- Overrides:
write in class DataWriter
- Throws:
DataException
writeImpl
protected void writeImpl(Record record)
throws Throwable
- Description copied from class:
DataWriter
- Overridden by subclasses to write the specified record to this
DataWriter.
- Specified by:
writeImpl in class DataWriter
- Throws:
Throwable
writeRecord
protected abstract void writeRecord(Record record)
throws Throwable
- Throws:
Throwable
Copyright (c) 2007-2009 North Concepts Inc. All Rights Reserved.