T
- the annotated class type.public class BeanListProcessor<T> extends AbstractBeanListProcessor<T,ParsingContext> implements RowProcessor
BeanProcessor
implementation for storing all java objects generated form the parsed input into a list.
A typical use case of this class will be:
parserSettings.setRowProcessor(new BeanListProcessor(MyObject.class)); parser.parse(reader); // will invoke the {@link BeanListProcessor#beanProcessed(Object, Context)} method for each generated object. List<T> beans = rowProcessor.getBeans();
BeanProcessor
,
RowProcessor
,
AbstractParser
,
AbstractBeanListProcessor
initialized, methodFilter, parsedFields, transformer
conversions
Constructor and Description |
---|
BeanListProcessor(Class<T> beanType)
Creates a processor that stores java beans of a given type into a list
|
BeanListProcessor(Class<T> beanType,
int expectedBeanCount)
Creates a processor that stores java beans of a given type into a list
|
beanProcessed, getBeans, getHeaders, processEnded, processStarted
rowProcessed
addConversion, cloneConversions, createBean, getBeanClass, getColumnMapper, initialize, initialize, initialize, isStrictHeaderValidationEnabled, processField, reverseConversions, setColumnMapper, setStrictHeaderValidationEnabled
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processEnded, processStarted, rowProcessed
public BeanListProcessor(Class<T> beanType)
beanType
- the class with its attributes mapped to fields of records parsed by an AbstractParser
or written by an AbstractWriter
.public BeanListProcessor(Class<T> beanType, int expectedBeanCount)
beanType
- the class with its attributes mapped to fields of records parsed by an AbstractParser
or written by an AbstractWriter
.expectedBeanCount
- expected number of rows to be parsed from the input which will be converted into java beans.
Used to pre-allocate the size of the output List
returned by AbstractBeanListProcessor.getBeans()
Copyright © 2019 Univocity Software Pty Ltd. All rights reserved.