Top Description Fields Constructors Methods
com.univocity.parsers.common.processor

public Class ObjectRowWriterProcessor

extends DefaultConversionProcessor
implements RowWriterProcessor<Object[]>
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.processor.RowWriterProcessor
Imports
com.univocity.parsers.common.*, com.univocity.parsers.conversions.*

A RowWriterProcessor implementation for executing conversion sequences in object arrays before for writing them using any implementation of AbstractWriter.
Author
Univocity Software Pty Ltd - [email protected]
See Also
AbstractWriter, RowWriterProcessor

Field Summary

Modifier and TypeField and Description
private NormalizedString[]
private String[]
Inherited from com.univocity.parsers.common.DefaultConversionProcessor:
conversions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object[]

Returns:

an row of Object instances containing the values obtained after the execution of all conversions.

Fields that do not have any conversion defined will just be copied to the object array into their original positions.

write
(Object[]
the object array that represents a record with its individual fields.
input
,
String[]
All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings#getHeaders()
headers
,
int[]
The indexes of the headers that are actually being written. May be null if no fields have been selected using CommonSettings#selectFields(String...) or CommonSettings#selectIndexes(Integer...)
indexesToWrite
)

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#convertAll(Conversion...), for every field in the given row.

public Object[]

Returns:

an row of Object instances containing the values obtained after the execution of all conversions.

Fields that do not have any conversion defined will just be copied to the object array into their original positions.

write
(Object[]
the object array that represents a record with its individual fields.
input
,
NormalizedString[]
All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings#getHeaders()
headers
,
int[]
The indexes of the headers that are actually being written. May be null if no fields have been selected using CommonSettings#selectFields(String...) or CommonSettings#selectIndexes(Integer...)
indexesToWrite
)

Implements com.univocity.parsers.common.processor.RowWriterProcessor.write.

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#convertAll(Conversion...), for every field in the given row.
Inherited from com.univocity.parsers.common.DefaultConversionProcessor:
applyConversionsconvertAllconvertFieldsconvertIndexesconvertTypehandleConversionErrorinitializeConversionsreverseConversionstoDataProcessingException

Field Detail

normalizedHeadersback to summary
private NormalizedString[] normalizedHeaders
previousHeadersback to summary
private String[] previousHeaders

Constructor Detail

ObjectRowWriterProcessorback to summary
public ObjectRowWriterProcessor()

Method Detail

writeback to summary
public Object[] write(Object[] input, String[] headers, int[] indexesToWrite)

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#convertAll(Conversion...), for every field in the given row.

Each field will be transformed using the Conversion#execute(Object) method.

In general the conversions will process a String and convert it to some object value (such as booleans, dates, etc).

Parameters
input:Object[]

the object array that represents a record with its individual fields.

headers:String[]

All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings#getHeaders()

indexesToWrite:int[]

The indexes of the headers that are actually being written. May be null if no fields have been selected using CommonSettings#selectFields(String...) or CommonSettings#selectIndexes(Integer...)

Returns:Object[]

an row of Object instances containing the values obtained after the execution of all conversions.

Fields that do not have any conversion defined will just be copied to the object array into their original positions.

writeback to summary
public Object[] write(Object[] input, NormalizedString[] headers, int[] indexesToWrite)

Implements com.univocity.parsers.common.processor.RowWriterProcessor.write.

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#convertAll(Conversion...), for every field in the given row.

Each field will be transformed using the Conversion#execute(Object) method.

In general the conversions will process a String and convert it to some object value (such as booleans, dates, etc).

Parameters
input:Object[]

the object array that represents a record with its individual fields.

headers:NormalizedString[]

All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings#getHeaders()

indexesToWrite:int[]

The indexes of the headers that are actually being written. May be null if no fields have been selected using CommonSettings#selectFields(String...) or CommonSettings#selectIndexes(Integer...)

Returns:Object[]

an row of Object instances containing the values obtained after the execution of all conversions.

Fields that do not have any conversion defined will just be copied to the object array into their original positions.

Annotations
@Override