Thank you and Grazie to all that replied!

      From: Greg Thomas <[email protected]>
 To: Commons Users List <[email protected]>; Alfonso Via-Reque 
<[email protected]> 
 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 <[email protected]> 
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



   

Reply via email to