Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D17ADC2E9 for ; Mon, 10 Mar 2014 12:24:09 +0000 (UTC) Received: (qmail 656 invoked by uid 500); 10 Mar 2014 12:24:05 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 99238 invoked by uid 500); 10 Mar 2014 12:23:48 -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 99092 invoked by uid 99); 10 Mar 2014 12:23:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 12:23:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 209.85.214.179 as permitted sender) Received: from [209.85.214.179] (HELO mail-ob0-f179.google.com) (209.85.214.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 12:23:39 +0000 Received: by mail-ob0-f179.google.com with SMTP id va2so6880173obc.38 for ; Mon, 10 Mar 2014 05:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=lQkJv3Cipp5LYwqsYZ3tozOdjd1Mtzoe5gtws6D19hY=; b=cd77bcYI7A5QJL/+kxLkJOPjDRPZg2cns79JVzmpUTaKiij/dtoqoRk3saic0+wxIz 8sxKUY54lPhNByI9sKaTTOfHCCwSigGyl3XeqsDxOIM2fdQGnay7IMwXXLS+Vb16zSFG w+FX69Sg0FJ1yiKB5UGumj0guL9kysIip42L5vYJGlf9kBF/ilgaH8lIfK5kpUdoMgd/ dYnUU0zy5PslBkdc2pMKK1im1tX0bLNYsnh+nZ7eyt11xMb2kTR7uCExfcKRw9dxTL07 B223XhfDzcym1QXX9/SQhimzHNAq4Jtn2VVy7Lv/nPttY6NWHJp6Wmp++0dJxJe558xx SysA== MIME-Version: 1.0 X-Received: by 10.60.232.105 with SMTP id tn9mr23516713oec.11.1394454199186; Mon, 10 Mar 2014 05:23:19 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.60.42.69 with HTTP; Mon, 10 Mar 2014 05:23:19 -0700 (PDT) In-Reply-To: <08B0FA952B167E4CA0C41C49254A81664951CC92@srv-im-exchange.intern.infomotion.de> References: <08B0FA952B167E4CA0C41C49254A81664951ACB6@srv-im-exchange.intern.infomotion.de> <08B0FA952B167E4CA0C41C49254A81664951C5CC@srv-im-exchange.intern.infomotion.de> <08B0FA952B167E4CA0C41C49254A81664951CC92@srv-im-exchange.intern.infomotion.de> Date: Mon, 10 Mar 2014 13:23:19 +0100 X-Google-Sender-Auth: R20IpQvATpPSQlEQSFl2irNsz1g Message-ID: Subject: Re: [digester] Multiple paths mapped to one object From: Simone Tripodi To: Commons Users List Content-Type: multipart/alternative; boundary=001a1136a1c632bb3104f43fab30 X-Virus-Checked: Checked by ClamAV on apache.org --001a1136a1c632bb3104f43fab30 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable sorry to reply a little late, I've been quiet busy during the WE I am having a look at your test case tonight, stay tuned! Alles Gute, -Simo http://people.apache.org/~simonetripodi/ http://twitter.com/simonetripodi On Thu, Mar 6, 2014 at 5:26 PM, Jan Fr=C3=B6hlich wrote: > Hi Simo, > > I created a small maven project with 2 test cases inside. One works but i= s > ugly, the other fails but would be great. > As I don't want to spam this mailing list I uploaded it to our webserver > as ZIP file. > > You can download it from > http://www.infomotion.de/download/objectcreate-test.zip > > I didn't comment it at all, but tried to give it speaking names. > Looking forward for your feedback. > > Thank you for your help so far! > > Jan > > -----Urspr=C3=BCngliche Nachricht----- > Von: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] Im > Auftrag von Simone Tripodi > Gesendet: Donnerstag, 6. M=C3=A4rz 2014 16:43 > An: Commons Users List > Betreff: Re: [digester] Multiple paths mapped to one object > > Hi Jan, > could you submit a testcase, please? > I will have a look at it and get back with a solution ASAP :) Alles Gute, > -Simo > > > http://people.apache.org/~simonetripodi/ > http://twitter.com/simonetripodi > > > On Thu, Mar 6, 2014 at 1:09 PM, Jan Fr=C3=B6hlich >wrote: > > > Hi Simone, > > > > this is something I already tried. > > First: > > With a single @ObjectCreate for each table it works fine. > > Then: > > Changing only to @ObjectCreate.List - without any other > > modifications I get an error saying that there is no setter Method in > > the table class. > > Second: > > The @SetProperty attribute "pattern" is mandatory. > > > > Maybe this is something version dependent? I use > > > > org.apache.commons > > commons-digester3 > > 3.2 > > > > > > Jan > > > > -----Urspr=C3=BCngliche Nachricht----- > > Von: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] Im > > Auftrag von Simone Tripodi > > Gesendet: Donnerstag, 6. M=C3=A4rz 2014 12:05 > > An: Commons Users List > > Betreff: Re: [digester] Multiple paths mapped to one object > > > > Hi Jan, > > > > there's no kind of magic, just annotate the class fields as: > > > > @ObjectCreate.List(value =3D { > > @ObjectCreate(pattern =3D "*/HTABLE"), > > @ObjectCreate(pattern =3D "*/VTABLE"), > > @ObjectCreate(pattern =3D "*/XTABLE") > > }) > > public class Table { > > > > @SetProperty // you can omit the 'attributeName' since it is the > > same as in the attribute > > private String name; > > > > @SetProperty(attributeName =3D "x") > > private Long posX; > > > > @SetProperty(attributeName =3D "y") > > private Long posY; > > > > @BeanPropertySetter(pattern =3D "*/rows") > > private Long rows; > > > > } > > > > please let us know if it works! :) > > Alles Gute! > > -Simo > > > > http://people.apache.org/~simonetripodi/ > > http://twitter.com/simonetripodi > > > > > > On Wed, Mar 5, 2014 at 11:55 AM, Jan Fr=C3=B6hlich > > wrote: > > > > > Hi all, > > > > > > given an XML with something like > > > > > > > > > 10 > > > > > > > > > 14 > > > > > > > > > 17 > > > > > > > > > > > > I would like to map all nodes (XTABLE, VTABLE and HTABLE) to one > > > class Table and set the properties. > > > While learning digester I created a class for each tag, but now I > > > want to improve that. > > > > > > For the class itself the following should work > > > @ObjectCreate.List(value =3D { > > > @ObjectCreate(pattern =3D "*/HTABLE"), > > > @ObjectCreate(pattern =3D "*/VTABLE"), > > > @ObjectCreate(pattern =3D "*/XTABLE") > > > }) > > > public class Table { > > > private String name; > > > private Long posX; > > > private Long posY; > > > private Long rows; > > > > > > } > > > > > > But how should I annotate the properties as I have to set the > > > pattern attribute to all @SetProperty annotations and the pattern is > > > different for all of them. > > > > > > Any help appreciated. > > > > > > Jan > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > For additional commands, e-mail: user-help@commons.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --001a1136a1c632bb3104f43fab30--