com.univocity.parsers.common.processor
Class BeanListProcessor<T>

java.lang.Object
  extended by com.univocity.parsers.common.DefaultConversionProcessor
      extended by com.univocity.parsers.common.processor.core.AbstractBeanConversionProcessor<T>
          extended by com.univocity.parsers.common.processor.core.AbstractBeanProcessor<T,C>
              extended by com.univocity.parsers.common.processor.core.AbstractBeanListProcessor<T,ParsingContext>
                  extended by com.univocity.parsers.common.processor.BeanListProcessor<T>
Type Parameters:
T - the annotated class type.
All Implemented Interfaces:
ConversionProcessor, Processor<ParsingContext>, RowProcessor

public class BeanListProcessor<T>
extends AbstractBeanListProcessor<T,ParsingContext>
implements RowProcessor

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&lt;T&gt; beans = rowProcessor.getBeans();
 

Author:
uniVocity Software Pty Ltd - parsers@univocity.com
See Also:
BeanProcessor, RowProcessor, AbstractParser, AbstractBeanListProcessor

Field Summary
 
Fields inherited from class com.univocity.parsers.common.processor.core.AbstractBeanConversionProcessor
initialized, parsedFields
 
Constructor Summary
BeanListProcessor(Class<T> beanType)
          Creates a processor that stores java beans of a given type into a list
 
Method Summary
 
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractBeanListProcessor
beanProcessed, getBeans, getHeaders, processEnded, processStarted
 
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractBeanProcessor
rowProcessed
 
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractBeanConversionProcessor
createBean, getBeanClass, initialize, isStrictHeaderValidationEnabled, processField, reverseConversions, setStrictHeaderValidationEnabled
 
Methods inherited from class com.univocity.parsers.common.DefaultConversionProcessor
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, reverseConversions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
 

Constructor Detail

BeanListProcessor

public BeanListProcessor(Class<T> beanType)
Creates a processor that stores java beans of a given type into a list

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


Copyright © 2016 uniVocity Software Pty Ltd. All rights reserved.