Class CsvWriter

java.lang.Object
de.espirit.common.util.CsvWriter

public class CsvWriter extends Object
Utility class to write CSV files.
Since:
5.1.28
  • Constructor Summary

    Constructors
    Constructor
    Description
    CsvWriter(Writer writer)
    Constructs a new CsvWriter with the given writer
    CsvWriter(Writer writer, char delim)
    Constructs a new CsvWriter with the given writer and the given char as delimiter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close writer
    void
    write(double value)
    write method, which writes an double value
    void
    write(int integer)
    write method, which writes an integer value
    void
    write(String string)
    write method, which writes a string
    void
    write(Date date)
    writes a date with default the format "dd.MM.yyy"
    void
    write(Date date, DateFormat dateFormatter)
    write method, which writes date object
    void
    makes a new line with carriage return (code xx) plus line feed (code yy) ('\r\n')
    void
    makes a new line with variable breakes

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CsvWriter

      public CsvWriter(Writer writer)
      Constructs a new CsvWriter with the given writer
      Parameters:
      writer - writer for the file
      Since:
      5.1.28
    • CsvWriter

      public CsvWriter(Writer writer, char delim)
      Constructs a new CsvWriter with the given writer and the given char as delimiter
      Parameters:
      writer - writer for the file
      delim - the delimiter char
      Since:
      5.1.28
  • Method Details

    • write

      public void write(Date date) throws IOException
      writes a date with default the format "dd.MM.yyy"
      Parameters:
      date - date object
      Throws:
      IOException
      Since:
      5.1.28
    • write

      public void write(Date date, DateFormat dateFormatter) throws IOException
      write method, which writes date object
      Parameters:
      date - date object
      dateFormatter - format of date like "dd.MM.yyyy"
      Throws:
      IOException
      Since:
      5.1.28
    • write

      public void write(int integer) throws IOException
      write method, which writes an integer value
      Parameters:
      integer - value
      Throws:
      IOException
      Since:
      5.1.28
    • write

      public void write(double value) throws IOException
      write method, which writes an double value
      Parameters:
      value -
      Throws:
      IOException
      Since:
      5.1.28
    • write

      public void write(String string) throws IOException
      write method, which writes a string
      Parameters:
      string - writes the specified string csv-encoded
      Throws:
      IOException
      Since:
      5.1.28
    • writeNewLine

      public void writeNewLine() throws IOException
      makes a new line with carriage return (code xx) plus line feed (code yy) ('\r\n')
      Throws:
      IOException
      Since:
      5.1.28
    • writeNewLine

      public void writeNewLine(String newLine) throws IOException
      makes a new line with variable breakes
      Parameters:
      newLine - string as '\r','\n','\r\n'
      Throws:
      IOException
      Since:
      5.1.28
    • close

      public void close() throws IOException
      close writer
      Throws:
      IOException
      Since:
      5.1.28