Class CSVWriter<T>

java.lang.Object
me.landmesser.simplecsv.CSVWriter<T>
Type Parameters:
T - the type of objects that serve as input for the csv output.
All Implemented Interfaces:
Closeable, AutoCloseable

public class CSVWriter<T>
extends Object
implements Closeable
Offers the possibility to write a CSV file to an Appendable, e.g. a Writer by transforming a stream of objects of type T.

The class of type T is parsed for annotations to customize the behaviour of the writer.

  • Constructor Summary

    Constructors 
    Constructor Description
    CSVWriter​(Appendable writer, Class<T> type, org.apache.commons.csv.CSVFormat format, boolean withHeaders)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    protected String convert​(Class<?> type, Object object)  
    protected String determineGetter​(me.landmesser.simplecsv.CSVEntry entry)  
    protected String determineSetter​(me.landmesser.simplecsv.CSVEntry entry)  
    ColumnNameStyle getColumnNameStyle()  
    List<me.landmesser.simplecsv.CSVEntry> getEntries()  
    org.apache.commons.csv.CSVFormat getFormat()  
    Class<T> getType()  
    protected <R> R parse​(Class<R> type, String value)  
    protected List<me.landmesser.simplecsv.CSVEntry> parseClass​(Class<T> type)  
    protected void setFormat​(org.apache.commons.csv.CSVFormat format)  
    void write​(Stream<T> objects)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait