tags:

views:

32

answers:

2

Like when I export/serialize my bean to an xml file (using XStream) I get a nice API and I can easily restrict what shouldn't go into export calling XStream#omitField(SerializableBean.class, "restrictedField"), is there any such API for doing CSV exports in java which could provide this functionality?

A: 

Take a look at jsefa which supports the way you looking for.

khmarbaise
JSefa seems nice but the project has no advanced tutorial and no mailing-list. Where can I ask questions like dynamic positioning of elements (during serialization) and what method to call to omit fields?
nabeelalimemon
A: 

SuperCSV library has exactly what I was looking for. Just take a look at this example and remove the field name (that you want to restrict from being exported) from "header" array. Nice and simple.

nabeelalimemon