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 867734683 for ; Fri, 13 May 2011 23:32:28 +0000 (UTC) Received: (qmail 55057 invoked by uid 500); 13 May 2011 23:32:27 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 54969 invoked by uid 500); 13 May 2011 23:32:27 -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 54960 invoked by uid 99); 13 May 2011 23:32:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 23:32:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 74.125.82.49 as permitted sender) Received: from [74.125.82.49] (HELO mail-ww0-f49.google.com) (74.125.82.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 23:32:22 +0000 Received: by wwb39 with SMTP id 39so2988199wwb.6 for ; Fri, 13 May 2011 16:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UiUUMRINKdvRO6bJ/Pdv+WGaO/LmuZovLYh3Uvvjkhc=; b=K5BdpQfdpXnMtVgPBkVUjyFDxYJfSk/DFNmkhmbAThvk6D/qMWf5+IEy25SQ5Vk2Uf 8soMCWXfMVxshBAs6TsKsKE3m+hqNq7VYtB+8WbX/Cr7yRSot65JkBliBEVxZ31NHTrr 2K7OMrqHVpc3/66hJDXK/5cYNWVHfEVZYIN2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=wlPSQO/POG9R3Jw6jOKl8Ic2CV/cdPe3QpxkfKQraHGx0Mvv4yYohRTSLkfAiSIFtQ f7CuZD1qcgQTJ6FBVxdL5mwUOYVrrws4bLLQ3x2BuDqFgPd147DJN/UmrCHDrdqIEqyb EB9vJD6OsFC8hEBedziJyzFSb3CInYhIkDe+0= MIME-Version: 1.0 Received: by 10.227.199.68 with SMTP id er4mr1986789wbb.47.1305329521355; Fri, 13 May 2011 16:32:01 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.227.68.129 with HTTP; Fri, 13 May 2011 16:32:01 -0700 (PDT) In-Reply-To: <4DCDAC7E.4040809@christopherschultz.net> References: <4DCDA3A2.9070607@christopherschultz.net> <4DCDA68D.5040102@christopherschultz.net> <4DCDAC7E.4040809@christopherschultz.net> Date: Sat, 14 May 2011 01:32:01 +0200 X-Google-Sender-Auth: JQbOiQsC6AoU3FcxaFQn4F9M82g Message-ID: Subject: Re: [digester] Grabbing data from sub-element attributes From: Simone Tripodi To: Commons Users List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Christopher, I suggest you following Rahul's suggestion, SetNestedPropertiesRule is not efficient as a direct invocation. Moreover, for foo/bar properties, there's a 3rd way to set them: d.addObjectCreate("entities/entity", Entity.class); d.addBeanPropertySetter("entities/entity/foo"); d.addBeanPropertySetter("entities/entity/bar"); d.addCallMethod("entities/entity/baz", "setBaz", 1); d.addCallParam("entities/entity/baz", 0, "id"); HTH, Simo http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Sat, May 14, 2011 at 12:11 AM, Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Rahul, > > On 5/13/2011 5:53 PM, Rahul Akolkar wrote: >> Yeah, and probably more than one way even with out of the box rules: >> >> =C2=A0 d.addObjectCreate("entities/entity", Entity.class); >> =C2=A0 d.addCallMethod("entities/entity/foo", "setFoo", 0); >> =C2=A0 d.addCallMethod("entities/entity/bar", "setBar", 0); >> =C2=A0 d.addCallMethod("entities/entity/baz", "setBaz", 1); >> =C2=A0 d.addCallParam("entities/entity/baz", 0, "id"); > > Thanks for the tip... that might actually be somewhat simpler code than > I have now. I'm using setNestedProperties and enumerating them because I > need to re-name some of the properties. But, that requires that I > enumerate all of them, even those I want to ignore, otherwise I'll get > an error. If I use addCallMethod, the Digester will probably ignore > anything for which there is no rule. > > Thanks, > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk3NrH4ACgkQ9CaO5/Lv0PASVwCfSEYMFGwDYuOj0fZvaFuDl+YD > 9tkAoIOnGQk4ERImSnU7LVW501rYjYEF > =3D7vJb > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > 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