Parse CSV and map to a given class.
Parser parser = new Parser(); List<MyClass> results = parser.parse(file, MyClass.class);
Annotate private member variables with @CSVColumn. Set value equal to the name of the column as viewed in Excel
@CSVColumn(value = "A")
Defining class map
public class MyClass {
@CSVColumn(value = "A")
private String firstName;
@CSVColumn(value = "B")
private String lastName;
@CSVColumn(value = "G")
private int age;
// Getters & Setters
}
Converts value to Date
@CSVDate(pattern = "MM-dd-yyyy")
Data types supported
Format used by java.text.SimpleDateFormat