com.univocity.api.engine
Interface RowMappingContext

All Superinterfaces:
EngineExecutionContext, EntityMappingContext, MappingCycleContext

public interface RowMappingContext
extends EntityMappingContext, EngineExecutionContext, MappingCycleContext

The RowMappingContext is available to RowReader instances used during the execution of a data mapping between two entities. It provides information specific to the mapping being executed, as well as access to the DataIntegrationEngine execution context.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
RowReader, EntityMappingContext, EngineExecutionContext, MappingCycleContext

Method Summary
 void discardRow()
          Discards the current row being processed.
 int getCurrentRow()
          Return the current count of rows processed.
 String[] getInputFields()
          Returns the sequence of fields read from the input data entity.
 int getInputIndex(String fieldName)
          Returns the position of a field in the input row.
 Object getInputValue(String fieldName)
          Returns the value of a given field in the current input row.
<T> T
getInputValue(String fieldName, Class<T> fieldType)
          Returns the value of a given field in the current input row.
 String[] getOutputFields()
          Returns the sequence of fields read from the output data entity (if available).
 int getOutputIndex(String fieldName)
          Returns the position of a field in the output row (if available).
 Object getOutputValue(String fieldName)
          Returns the value of a given field in the current output row.
<T> T
getOutputValue(String fieldName, Class<T> fieldType)
          Returns the value of a given field in the current output row.
 void setInputValue(String fieldName, Object value)
          Modifies the value of a given field in the current input row.
 void setOutputValue(String fieldName, Object value)
          Modifies the value of a given field in the current output row.
 
Methods inherited from interface com.univocity.api.engine.EntityMappingContext
getDestinationDataStore, getDestinationEntity, getSourceDataStore, getSourceEntity, isEntityMappingSkipped, isExclusionMapping, skipEntityMapping
 
Methods inherited from interface com.univocity.api.engine.EngineExecutionContext
containsVariable, evaluateExpression, executeFunction, getCurrentActiveScope, readVariable, setVariable
 
Methods inherited from interface com.univocity.api.engine.MappingCycleContext
abortCycle
 

Method Detail

discardRow

void discardRow()
Discards the current row being processed. This behavior varies depending where the RowReader is applied:


getInputIndex

int getInputIndex(String fieldName)
Returns the position of a field in the input row.

Parameters:
fieldName - the name of a field in the input row.
Returns:
the position of the given field name in the input row.

getOutputIndex

int getOutputIndex(String fieldName)
Returns the position of a field in the output row (if available).

Parameters:
fieldName - the name of a field in the output row.
Returns:
the position of the given field name in the output row.

getCurrentRow

int getCurrentRow()
Return the current count of rows processed.

Returns:
the current count of rows processed.

getInputFields

String[] getInputFields()
Returns the sequence of fields read from the input data entity.

Returns:
the sequence of fields read from the input data entity.

getOutputFields

String[] getOutputFields()
Returns the sequence of fields read from the output data entity (if available).

Returns:
the sequence of fields read from the output data entity.

getInputValue

Object getInputValue(String fieldName)
Returns the value of a given field in the current input row.

Parameters:
fieldName - name of the input field whose value will be returned.
Returns:
the value of the field in the current input row.

getOutputValue

Object getOutputValue(String fieldName)
Returns the value of a given field in the current output row.

Parameters:
fieldName - name of the output field whose value will be returned.
Returns:
the value of the field in the current output row.

setInputValue

void setInputValue(String fieldName,
                   Object value)
Modifies the value of a given field in the current input row.

Parameters:
fieldName - name of the input field whose value will be modified.
value - the new value of the field in the current input row.

setOutputValue

void setOutputValue(String fieldName,
                    Object value)
Modifies the value of a given field in the current output row.

Parameters:
fieldName - name of the output field whose value will be modified.
value - the new value of the field in the current output row.

getInputValue

<T> T getInputValue(String fieldName,
                    Class<T> fieldType)
Returns the value of a given field in the current input row.

Type Parameters:
T - fieldType the type of the value stored in the input field
Parameters:
fieldName - name of the input field whose value will be returned.
fieldType - the class of the value stored in the input field
Returns:
the value of the field in the current input row.

getOutputValue

<T> T getOutputValue(String fieldName,
                     Class<T> fieldType)
Returns the value of a given field in the current output row.

Type Parameters:
T - fieldType the type of the value stored in the output field
Parameters:
fieldName - name of the output field whose value will be returned.
fieldType - the class of the value stored in the output field
Returns:
the value of the field in the current output row.


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