commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfonso Via-Reque <avia...@yahoo.com.INVALID>
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 <greg.d.thomas@gmail.com>
 To: Commons Users List <user@commons.apache.org>; Alfonso Via-Reque <aviareq@yahoo.com>

 Sent: Thursday, January 19, 2017 2:31 AM
 Subject: Re: Read file into POJO
   
It's not an Apache project, but Gestalt @ https://github.com/tonybaines/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. 
Greg
On 19 January 2017 at 04:26, Alfonso Via-Reque <aviareq@yahoo.com.invalid> 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?


ThanksAlfonso



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