public class Collector extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor
next
Constructor and Description |
---|
Collector(java.util.Collection<java.lang.Object> collection)
Constructs a new Collector, which collects each value it encounters and adds it to the supplied
Collection.
|
Collector(java.util.Collection<java.lang.Object> collection,
CellProcessor next)
Constructs a new Collector, which collects each value it encounters, adds it to the supplied Collection,
then calls the next processor in the chain.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.lang.Object value,
CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.
|
java.util.Collection<java.lang.Object> |
getCollection()
Gets the collection of collected values.
|
toString, validateInputNotNull
public Collector(java.util.Collection<java.lang.Object> collection)
collection
- the collection to add tojava.lang.NullPointerException
- if collection is nullpublic Collector(java.util.Collection<java.lang.Object> collection, CellProcessor next)
collection
- the collection to add tonext
- the next processor in the chainjava.lang.NullPointerException
- if collection or next is nullpublic java.lang.Object execute(java.lang.Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextpublic java.util.Collection<java.lang.Object> getCollection()
Copyright © 2007-2014 Super CSV. All Rights Reserved.