public abstract class AbstractDataReader extends java.lang.Object implements DataReader
This is an abstract class which implements the DataReader
interface.
This implementation has defined most of the method in the interface.
Subclass are responsible for implementing the next()
method.
The subclass should also override the method getSourcePosition()
.
Constructor and Description |
---|
AbstractDataReader() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the data source used for reading data.
|
ConfigProperties |
getConfigProperties()
This method returns the configuration properties for this data reader.
|
java.lang.Integer |
getSourcePosition()
It returns the source position of the data object returned by the next() method
you called last time.
|
void |
init()
It gets the input csv data file for a DataReader and gets limeDelimiter, tokenDelimeter
and tokenValueDelimiter values.
|
ConfigProperties |
initConfig(org.w3c.dom.Node dataReaderNode,
ConfigProperties parentConfigProperties)
This method parses the
DataReader xml node read in from the business object configuration file
and stores the configuration in memory. |
abstract java.lang.Object |
next()
This method returns one chunk of data read from a data source.
|
void |
setConfigProperties(ConfigProperties aConfigProperties)
This method sets the configuration properties for this data reader.
|
public ConfigProperties getConfigProperties()
This method returns the configuration properties for this data reader.
getConfigProperties
in interface DataReader
public void setConfigProperties(ConfigProperties aConfigProperties)
This method sets the configuration properties for this data reader.
setConfigProperties
in interface DataReader
aConfigProperties
- The configuration properties for this data reader.public void init() throws DataLoadException
init
in interface DataReader
DataLoadException
public ConfigProperties initConfig(org.w3c.dom.Node dataReaderNode, ConfigProperties parentConfigProperties) throws DataLoadException
This method parses the DataReader
xml node read in from the business object configuration file
and stores the configuration in memory.
initConfig
in interface DataReader
dataReaderNode
- The DataReader
xml node read in from the business object configuration file.parentConfigProperties
- The configuration properties for the parent data loader of this data reader.DataLoadException
- An application exception will be thrown if there was a problem initializing the configuration for the data reader.public abstract java.lang.Object next() throws DataLoadException
next
in interface DataReader
DataLoadException
- An application exception will be thrown if there was a problem reading data from the data source.public java.lang.Integer getSourcePosition()
getSourcePosition
in interface DataReader
public void close() throws DataLoadException
Close the data source used for reading data. It does nothing. The subclass can overwrite it to provide a specific implementation.
close
in interface DataReader
DataLoadException
- An application exception will be thrown if there was a problem closing the data source.