public class ObjectRowWriterProcessor extends DefaultConversionProcessor implements RowWriterProcessor<Object[]>
RowWriterProcessor
implementation for executing conversion sequences in object arrays before for writing them using any implementation of AbstractWriter
.AbstractWriter
,
RowWriterProcessor
conversions
Constructor and Description |
---|
ObjectRowWriterProcessor() |
Modifier and Type | Method and Description |
---|---|
Object[] |
write(Object[] input,
NormalizedString[] 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. |
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. |
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException
public Object[] write(Object[] input, String[] headers, int[] indexesToWrite)
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).
input
- the object array that represents a record with its individual fields.headers
- All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings.getHeaders()
indexesToWrite
- 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...)
Fields that do not have any conversion defined will just be copied to the object array into their original positions.
public Object[] write(Object[] input, NormalizedString[] headers, int[] indexesToWrite)
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).
write
in interface RowWriterProcessor<Object[]>
input
- the object array that represents a record with its individual fields.headers
- All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings.getHeaders()
indexesToWrite
- 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...)
Fields that do not have any conversion defined will just be copied to the object array into their original positions.
CsvWriter
,
FixedWidthWriter
,
CommonSettings
,
AbstractWriter
Copyright © 2020 Univocity Software Pty Ltd. All rights reserved.