Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7038A200C01 for ; Thu, 19 Jan 2017 09:44:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6C1E5160B54; Thu, 19 Jan 2017 08:44:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BD444160B42 for ; Thu, 19 Jan 2017 09:44:00 +0100 (CET) Received: (qmail 65750 invoked by uid 500); 19 Jan 2017 08:43:59 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 65738 invoked by uid 99); 19 Jan 2017 08:43:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2017 08:43:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 13F55C0333 for ; Thu, 19 Jan 2017 08:43:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id oLMRjAyjV7lR for ; Thu, 19 Jan 2017 08:43:57 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8C3C35F477 for ; Thu, 19 Jan 2017 08:43:57 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id j15so21067147oih.2 for ; Thu, 19 Jan 2017 00:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=t2ptnUJPX0OcXvYAfNBCEC+d940ViIlOw0yc57TMOnI=; b=T9P+CDi6tYzUE2DK6oOaUjilQ7tyk5zfEMROwcEyky+mMp6Hw+keP/otbcrISwF34a hK//80uKf6umrf3V5pRo1olN61Dhgh3geyYm0vz8eUglPUa0cFlnTEkb/rqPqtdklwrL KB3nYczISC3jDAklZFWm8swwpKnK66XHM+ZFNC9Ff7x/QnAswKwqLJzoGopClZmUEFWQ idWtu6LdHI6Xr08Av+HJ3NJkWvN85ZAoZ8Hak5A1MO2dSxMO4pOUOKWWKTS2AQ16mVqq x1e6nLstqsvwzkndiFjXYAv7JMaTByqhiv7F7LZJq0Pion4y4BH2v9kNGMg5NO2LiYRr YnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=t2ptnUJPX0OcXvYAfNBCEC+d940ViIlOw0yc57TMOnI=; b=k8KqQ6iSE0fyWRRRzFwyfXo+NrftfTvqFLOTY8Bts3ZACGuByPONTTO+99g3uGT6// vONETPGEjeKudabnZt+LeVO+WSIDwiGpH4Vj7PAzRpjPx5y4oZb8SgUWT45EbZbvLtzM 1ca9peCP2LfCQuZ9+KmNmBCBoDqV398+jKPaiWGh19gXU82++3iZgu8t4lYibjcDeGir yVsRbu9J9hnFDfNdNSlV4DFMi2NfGgoMEAecedull308BQrd3DcpCwQkbR/0rQycPJ/s JnvRiyA0EzyO1a9G/4GInrj9a9AE9xVNP7Qh8S8AlMjWxD2r4X5SBwPBKCXaXOsSYeYl GpSA== X-Gm-Message-State: AIkVDXIxJDw40PsmIp6AC+MolyJ5EVY+uNov4n+6Ico+kYO4VfA22lfIA27DfaAtqtMfa+pSdUEEpeAEbeRo1Q== X-Received: by 10.202.206.73 with SMTP id e70mr3976328oig.134.1484815431597; Thu, 19 Jan 2017 00:43:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.33.130 with HTTP; Thu, 19 Jan 2017 00:43:51 -0800 (PST) In-Reply-To: <18954225.304331.1484800017986@mail.yahoo.com> References: <18954225.304331.1484800017986.ref@mail.yahoo.com> <18954225.304331.1484800017986@mail.yahoo.com> From: Gary Gregory Date: Thu, 19 Jan 2017 00:43:51 -0800 Message-ID: Subject: Re: Read file into POJO To: Commons Users List , Alfonso Via-Reque Content-Type: multipart/alternative; boundary=001a113d29205b833e05466e889e archived-at: Thu, 19 Jan 2017 08:44:01 -0000 --001a113d29205b833e05466e889e Content-Type: text/plain; charset=UTF-8 JAXB is included in Java. Gary On Wed, Jan 18, 2017 at 8:26 PM, 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 -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --001a113d29205b833e05466e889e--