Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 18122 invoked from network); 8 Dec 2003 21:48:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Dec 2003 21:48:07 -0000 Received: (qmail 16612 invoked by uid 500); 8 Dec 2003 21:47:51 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 16450 invoked by uid 500); 8 Dec 2003 21:47:50 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 16436 invoked from network); 8 Dec 2003 21:47:50 -0000 Received: from unknown (HELO unxcoms01.ecnetwork.co.nz) (202.135.116.201) by daedalus.apache.org with SMTP; 8 Dec 2003 21:47:50 -0000 Received: from serpent.ecnetwork.co.nz (serpent [202.135.190.10]) by unxcoms01.ecnetwork.co.nz (8.12.8/8.12.8) with ESMTP id hB8LlsIx004134 for ; Tue, 9 Dec 2003 10:47:54 +1300 Received: from pcjohns.ecnnz.ecnetwork.co.nz (pcjohns.ecnnz.ecnetwork.co.nz [202.135.190.30]) by serpent.ecnetwork.co.nz (Postfix) with ESMTP id 84E051035 for ; Tue, 9 Dec 2003 09:51:25 +1200 (NZST) Subject: Re: [Digester] addBeanPropertySetter help From: Simon Kitching Reply-To: simon@ecnetwork.co.nz To: Jakarta Commons Users List In-Reply-To: References: Content-Type: text/plain Organization: The Electronic Commerce Network Ltd. Message-Id: <1070920072.11438.62.camel@pcjohns.ecnnz.ecnetwork.co.nz> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4-8mdk Date: Tue, 09 Dec 2003 10:47:54 +1300 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Craig, On Tue, 2003-12-09 at 08:57, Craig Tataryn wrote: > Sorry, forgot to specify which commons project this was for in the subject. > > > >From: "Craig Tataryn" > >Reply-To: "Jakarta Commons Users List" > >To: commons-user@jakarta.apache.org > >Subject: addBeanPropertySetter help > >Date: Mon, 08 Dec 2003 13:53:14 -0600 > > > >Hi, I have an XML file that looks like this: > > > > > > > > > > >class="StoredProcDataDispatch"> > > Data > > 192.168.200.1 > > 2638 > > test > > dba > > pwd > > > > > > > > > > > > > > > >Basically the tags below data-mappings/dispatchers/dispatcher are going to > >be adhoc (they represent properties on the StoredProcDataDispatch instance > >which will be set). I tried setting these properties by the following > >code: > > > >digester.addObjectCreate("data-mappings/dispatchers/dispatcher","class",java.lang.Object.class); > >digester.addBeanPropertySetter("data-mappings/dispatchers/dispatcher/*"); > > > >But the properties on the object are never set :( Is there a rule I can > >use where I can provide a pattern for a root node (i.e. > >data-mappings/dispatchers/dispatcher) and have all the child nodes below it > >act as property setters much like the addSetProperties rule works for > >attributes. > > > >Thanks, > > > >Craig. The default Rules object (which decides which rules are matched by the current xml element) supports *leading* wildcards but not *trailing* wildcards, ie "*/foo" works, "foo/*" does not. The ExtendedBaseRules class does support trailing wildcards (but is less efficient than the default implementation). See the examples directory in CVS for a demonstration of how to use this. The SetNestedPropertiesRule can also be used to do what you want, but as this has been added since the last release you will need to use a recent CVS snapshot of Digester if you want this rule. Digester is hopefully having a new release soon (in the next month?), at which point both the examples and the SetNestedPropertiesRule will be in the main release. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org