Le 13/03/2012 00:56, sebb a écrit :

1. Do nothing and address it in the next release with the bean mapping.
Parsing the file would then look like this:

  CSVFormat<Person>  format = CSVFormat.DEFAULT.withType(Person.class);
  for (Person person : format.parse(in)) {
      persons.add(person);
  }


Does this automatically mean that the file has a header?
Or is there another way to link columns to Person attributes?

If the file doesn't have a header, the fields are matched by index (either the natural ordering of the attributes in the class, or specified by an annotation).

If the file has a header, the fields are matched by attribute name, and an annotation can override the name of the column associated to an attribute.


Emmanuel Bourg

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to