T
- the type that is converted by this implementation into an Object array, suitable for writing to the output.public interface RowWriterProcessor<T>
AbstractWriter
.
When writing to an output, the writer will obtain the RowWriterProcessor from CommonWriterSettings.getRowWriterProcessor()
, and
invoke write(Object, String[], int[])
to convert the input to an array of objects. This array of objects will in turn be handed to the writer to produce a record in the expected format.
uniVocity-parsers provides some useful default implementations of this interface in the package com.univocity.parsers.common.processor
, namely:
ObjectRowWriterProcessor
: used for executing conversions of Object values on input rows using instances of Conversion
before writing to the outputBeanWriterProcessor
: used for converting javabeans annotated with the annotations provided in package com.univocity.parsers.annotations
into an object row before writing to the outputAbstractWriter
,
CommonWriterSettings
Modifier and Type | Method and Description |
---|---|
Object[] |
write(T input,
String[] headers,
int[] indexesToWrite)
Converts the given input into an Object array that is suitable for writing.
|
Object[] write(T input, String[] headers, int[] indexesToWrite)
AbstractWriter
.input
- The original input record that must be converted into an Object array before writing to an output.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...)
CommonSettings.getSkipEmptyLines()
is false)CsvWriter
,
FixedWidthWriter
,
CommonSettings
,
AbstractWriter
Copyright © 2021 uniVocity Software Pty Ltd. All rights reserved.