Class CsvWriter.CsvWriterDSL<T>

java.lang.Object
org.simpleflatmapper.csv.CsvWriter.CsvWriterDSL<T>
Type Parameters:
T - the type of object to write
Direct Known Subclasses:
CsvWriter.DefaultCsvWriterDSL, CsvWriter.NoColumnCsvWriterDSL
Enclosing class:
CsvWriter<T>

public static class CsvWriter.CsvWriterDSL<T> extends Object
the csv writer DSL
  • Field Details

    • columns

      protected final CsvWriter.Column[] columns
    • mapper

      protected final org.simpleflatmapper.map.mapper.ContextualSourceFieldMapperImpl<T,Appendable> mapper
    • cellWriter

      protected final org.simpleflatmapper.lightningcsv.CellWriter cellWriter
    • classMeta

      protected final org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta
    • mapperConfig

      protected final org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig
    • skipHeaders

      protected final boolean skipHeaders
  • Method Details

    • to

      public CsvWriter<T> to(Appendable appendable) throws IOException
      Create a writer on the specified appendable for the type T
      Parameters:
      appendable - the appendable to write to
      Returns:
      a CsvWriter on the specified appendable
      Throws:
      IOException - If an I/O error occurs
    • columns

      public CsvWriter.CsvWriterDSL<T> columns(String... columnNames)
      Create a new DSL object identical to the current one but and append the specified columns
      Parameters:
      columnNames - the list of property names
      Returns:
      the new DSL
    • column

      public CsvWriter.CsvWriterDSL<T> column(String column, Object... property)
      Create a new DSL object identical to the current one but with the specified property added.
      Parameters:
      column - the property name
      property - the property properties
      Returns:
      the new DSL
    • column

      public CsvWriter.CsvWriterDSL<T> column(String column, Format format)
      Create a new DSL object identical to the current one but with the specified property added.
      Parameters:
      column - the property name
      format - the property formatter
      Returns:
      the new DSL
    • classMeta

      public CsvWriter.CsvWriterDSL<T> classMeta(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta)
      Create a new DSL object identical to the current one but with the specified classMeta.
      Parameters:
      classMeta - the classMeta
      Returns:
      the new DSL
    • mapperConfig

      public CsvWriter.CsvWriterDSL<T> mapperConfig(org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig)
      Create a new DSL object identical to the current one but with the specified mapperConfig.
      Parameters:
      mapperConfig - the mapperConfig
      Returns:
      the new DSL
    • cellWriter

      public CsvWriter.CsvWriterDSL<T> cellWriter(org.simpleflatmapper.lightningcsv.CellWriter cellWriter)
      Create a new DSL object identical to the current one but with the specified cellWriter.
      Parameters:
      cellWriter - the cellWriter
      Returns:
      the new DSL
    • separator

      public CsvWriter.CsvWriterDSL<T> separator(char separator)
    • quote

      public CsvWriter.CsvWriterDSL<T> quote(char quote)
    • escape

      public CsvWriter.CsvWriterDSL<T> escape(char escape)
    • endOfLine

      public CsvWriter.CsvWriterDSL<T> endOfLine(String endOfLine)
    • alwaysEscape

      public CsvWriter.CsvWriterDSL<T> alwaysEscape()
    • skipHeaders

      public CsvWriter.CsvWriterDSL<T> skipHeaders()
      Create a new DSL object identical to the current one except it will not append the headers to the appendable.
      Returns:
      the new DSL
    • mapperConfig

      public org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig()
    • newColumnMapDSL

      protected CsvWriter.CsvWriterDSL<T> newColumnMapDSL(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, CsvWriter.Column[] columns, org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig, org.simpleflatmapper.lightningcsv.CellWriter cellWriter, boolean skipHeaders)
    • newMapDSL

      protected CsvWriter.CsvWriterDSL<T> newMapDSL(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, CsvWriter.Column[] columns, org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig, org.simpleflatmapper.lightningcsv.CellWriter cellWriter, boolean skipHeaders)
    • newCsvWriterDSL

      protected CsvWriter.CsvWriterDSL<T> newCsvWriterDSL(CsvWriter.Column[] columns, org.simpleflatmapper.lightningcsv.CellWriter cellWriter, org.simpleflatmapper.map.mapper.ContextualSourceFieldMapperImpl<T,Appendable> mapper, org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, org.simpleflatmapper.map.MapperConfig<CsvColumnKey,?> mapperConfig, boolean skipHeaders)