Get the Column name Given in POJO for Open CSV

23 views Asked by At

I have a pojo class looks something like this.

 public record Application{
    @CsvBindByName(column= "ID")
    String id;
    @CsvBindByName(column= "NAME")
    String name;
    @CsvBindByName(column= "AGE")
    Integer age;  
} 

Currently I need to create a Header to generate a CSV where user might only require ID and AGE

so my header should look like ID,AGE and i know the pojo fields. how do I extract the string given to the each field in the annotation.

0

There are 0 answers