com.univocity.api.engine
Class RowReader

java.lang.Object
  extended by com.univocity.api.engine.RowReader

public abstract class RowReader
extends Object

A RowReader provides access to rows being processed during the mapping between two data entities. Use EntityMapping to provide row readers for accessing data while reading from a source entity and before or after writing to a destination entity.
With a RowReader, the user has easy access to the data:

The user can read and modify the contents of each row, and easily perform common tasks such as data monitoring, logging and statistics.
The initialize(RowMappingContext) and cleanup(RowMappingContext) methods can be overridden to allow initialization before and after the RowReader receives rows for processing.

A RowMappingContext object is available to allow greater control and provide information about the process in execution.

Functions, variables and other entities used by the DataIntegrationEngine are also available.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
EntityMapping, RowMappingContext

Constructor Summary
RowReader()
           
 
Method Summary
 void cleanup(RowMappingContext context)
          Cleans up the RowReader after the reading process.
 void initialize(RowMappingContext context)
          Gives the RowReader a chance to perform any initialization it requires before the first call to processRow(Object[], Object[], RowMappingContext) is made.
abstract  void processRow(Object[] inputRow, Object[] outputRow, RowMappingContext context)
          Processes a row extracted from the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowReader

public RowReader()
Method Detail

initialize

public void initialize(RowMappingContext context)
Gives the RowReader a chance to perform any initialization it requires before the first call to processRow(Object[], Object[], RowMappingContext) is made.

Note: this method is only invoked by uniVocity if there are rows in the input entity.

Parameters:
context - the contextual information and controls available to the user during the execution of a data mapping process.

processRow

public abstract void processRow(Object[] inputRow,
                                Object[] outputRow,
                                RowMappingContext context)
Processes a row extracted from the input.

Parameters:
inputRow - the original data in a record read from the input data entity
outputRow - the transformed data. The value of this parameter varies according to where the RowReader is applied in the EntityMapping:
context - the contextual information and controls available to the user during the execution of a data mapping process.

cleanup

public void cleanup(RowMappingContext context)
Cleans up the RowReader after the reading process. Note: this method is always invoked by uniVocity even if the input entity is empty or in case of exceptions.

Parameters:
context - the contextual information and controls available to the user after the execution of a data mapping process.


Copyright © 2014 uniVocity Software Pty Ltd. All rights reserved.