I'd like to generate a CSV file from a list of custom objects.
I have an abstract class:
public abstract class MyClass{
public static final String SEPARATOR = ";";
// many private variables
@Override
public String toString(){
// return all my variables values separated by SEPARATOR
}
}
and several concrete classes that inherit from this class.
I'd like to implment the toString() method only in this class, without re-implement in each concrete class.
Is there any useful library to acheve this or do I have to implement manually toString() method for each class? Should I use reflection?