T - the annotated class type.public class BeanWriterProcessor<T> extends BeanConversionProcessor<T> implements RowWriterProcessor<T>
RowWriterProcessor implementation for converting annotated java objects into object arrays suitable for writing in any implementation of AbstractWriter.
The class type of the object must contain the annotations provided in com.univocity.parsers.annotations.
For any given java bean instance, this processor will read and convert annotated fields into an object array.
AbstractWriter,
RowWriterProcessor,
BeanConversionProcessorinitialized, methodFilter, parsedFields, transformerconversions| Constructor and Description |
|---|
BeanWriterProcessor(Class<T> beanType)
Initializes the BeanWriterProcessor with the annotated bean class
|
| Modifier and Type | Method and Description |
|---|---|
protected FieldConversionMapping |
cloneConversions()
Creates a copy of the manually defined conversions to be applied over any columns.
|
Object[] |
write(T input,
NormalizedString[] headers,
int[] indexesToWrite)
Converts the java bean instance into a sequence of values for writing.
|
Object[] |
write(T input,
String[] headers,
int[] indexesToWrite)
Converts the java bean instance into a sequence of values for writing.
|
addConversion, createBean, getBeanClass, getColumnMapper, initialize, initialize, initialize, isStrictHeaderValidationEnabled, processField, reverseConversions, setColumnMapper, setStrictHeaderValidationEnabledapplyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingExceptionpublic BeanWriterProcessor(Class<T> beanType)
beanType - the class annotated with one or more of the annotations provided in com.univocity.parsers.annotations.public Object[] write(T input, String[] headers, int[] indexesToWrite)
input - an instance of the type defined in this class constructor.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...)public Object[] write(T input, NormalizedString[] headers, int[] indexesToWrite)
write in interface RowWriterProcessor<T>input - an instance of the type defined in this class constructor.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...)CsvWriter,
FixedWidthWriter,
CommonSettings,
AbstractWriterprotected FieldConversionMapping cloneConversions()
BeanConversionProcessorcloneConversions in class BeanConversionProcessor<T>Copyright © 2019 Univocity Software Pty Ltd. All rights reserved.