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

public Class BeanListProcessor<T>

extends AbstractBeanListProcessor<T, ParsingContext>
implements RowProcessor
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.processor.RowProcessor, com.univocity.parsers.common.processor.core.Processor
Type Parameters
<T>
the annotated class type.
Imports
com.univocity.parsers.common.*, com.univocity.parsers.common.processor.core.*, java.util.*

A convenience 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();

Author
Univocity Software Pty Ltd - [email protected]
See Also
BeanProcessor, RowProcessor, AbstractParser, AbstractBeanListProcessor

Constructor Summary

AccessConstructor and Description
public
BeanListProcessor(Class<T>
the class with its attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.
beanType
)

Creates a processor that stores java beans of a given type into a list

public
BeanListProcessor(Class<T>
the class with its attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.
beanType
,
int
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 getBeans()
expectedBeanCount
)

Creates a processor that stores java beans of a given type into a list

Method Summary

Inherited from com.univocity.parsers.common.processor.core.AbstractBeanListProcessor:
beanProcessedgetBeansgetHeadersprocessEndedprocessStarted

Constructor Detail

BeanListProcessorback to summary
public BeanListProcessor(Class<T> beanType)

Creates a processor that stores java beans of a given type into a list

Parameters
beanType:Class<T>

the class with its attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.

BeanListProcessorback to summary
public BeanListProcessor(Class<T> beanType, int expectedBeanCount)

Creates a processor that stores java beans of a given type into a list

Parameters
beanType:Class<T>

the class with its attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.

expectedBeanCount:int

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 getBeans()