commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfonso Via-Reque <>
Subject Read file into POJO
Date Thu, 19 Jan 2017 04:26:57 GMT
Hello Commons Users,
I'm looking for a way to read files directly into POJOs.  The idea is that the file layout
would be defined in an "properties"-type file (XML or something).  The layout could be delimited
or fixed-width, with the layout file defining the columns and which POJO member variable they
should be set to.
For example, a file might be tilde (~) delimited and follow this layout:ID~first name~last

I'd like to read it into a class:
public class Person {    private Integer id;
    private String firstName;
    private String lastName;    private Integer age;    private String address;   
private String city;
    private String state;
    private String zip;

    // Getters and Setters ...

Is there a tool that do this?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message