title: Using Univocity, how can I convert a date string value to a Date type in Java
body: <p>I'll like to parse column zero in a csv file to a particular datatype, in this example a Date Object.    </p>
  
  <p>The method below is what I use currently to parse a csv file but I don't know how to incorporate this requirement.</p>
  
  <pre><code>import java.sql.Date;
  public class Data {
  
      @Parsed(index = 0)
          private Date date;
      }
  }
  
  public &lt;T&gt; List&lt;T&gt; convertFileToData(File file, Class&lt;T&gt; clazz) {
  
      BeanListProcessor&lt;T&gt; rowProcessor = new BeanListProcessor&lt;&gt;(clazz);
      CsvParserSettings settings = new CsvParserSettings();
      settings.setProcessor(rowProcessor);
      settings.setHeaderExtractionEnabled(true);
  
      CsvParser parser = new CsvParser(settings);
      parser.parseAll(file);
  
      return rowProcessor.getBeans();
  }
  </code></pre>