commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfonso Via-Reque <>
Subject Re: Read file into POJO
Date Thu, 19 Jan 2017 13:26:55 GMT
Thank you and Grazie to all that replied!

      From: Greg Thomas <>
 To: Commons Users List <>; Alfonso Via-Reque <>

 Sent: Thursday, January 19, 2017 2:31 AM
 Subject: Re: Read file into POJO
It's not an Apache project, but Gestalt @ dos exactly
that. You define a Java interface, and Gestalt will create an object that implements interface
based on the contents of a .xml or .properties file. 
On 19 January 2017 at 04:26, Alfonso Via-Reque <> wrote:

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
name~age~address~city~state~ zip

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