Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 54247 invoked from network); 18 Jan 2005 21:14:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Jan 2005 21:14:53 -0000 Received: (qmail 81491 invoked by uid 500); 18 Jan 2005 21:14:48 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 81361 invoked by uid 500); 18 Jan 2005 21:14:47 -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 81347 invoked by uid 99); 18 Jan 2005 21:14:47 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of robertburrelldonkin@blueyonder.co.uk designates 195.188.213.5 as permitted sender) Received: from smtp-out2.blueyonder.co.uk (HELO smtp-out2.blueyonder.co.uk) (195.188.213.5) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 18 Jan 2005 13:14:46 -0800 Received: from [10.0.0.2] ([82.38.65.173]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Tue, 18 Jan 2005 21:15:15 +0000 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <41E70046.8090601@metalexis.com> References: <8E2D018A78A5A04095667ADF098FF29A5ACD0F@ms06> <41E70046.8090601@metalexis.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: robert burrell donkin Subject: Re: [betwixt] Collection property question Date: Tue, 18 Jan 2005 21:14:39 +0000 To: "Jakarta Commons Users List" X-Mailer: Apple Mail (2.619) X-OriginalArrivalTime: 18 Jan 2005 21:15:15.0678 (UTC) FILETIME=[CE0E27E0:01C4FDA2] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi matt i think that your problem is that the plurals aren't being recognized correctly. in these circumstances, betwixt will write correctly but isn't able to read. i suspect that you're suffixes may be confusing betwixt and you may need to use a custom PluralStemmer strategy. - robert On 13 Jan 2005, at 23:12, Matt Goodwin wrote: > public void testReadBean() { > try { > File file = new File(FILE1); > BeanReader beanReader = new BeanReader(); > beanReader.registerBeanClass(AgentStatement.class); > AgentStatement statement = > (AgentStatement)beanReader.parse(file); > } catch(Exception e) { > fail(e.getMessage()); > } } > > xml file: > > 2004/10/08 > > > xxxx > xxxx > xxxx > xxxx > xxxx > xx > xxxxx > xxxx > xxxx > > > xxxx > xxxx > xxxx > xxxx > 2004/10/04 > 2004/10/05 > xxxx > 0 > 0 > 0.0 > 0 > xxxx > 0 > > > xxxx > xxxx > xxxx > xxxx > 2004/10/04 > 2004/10/05 > xxxx > 0 > 0 > 0.0 > 0 > xxxx > 0 > > > 0.0 > 0.0 > 0 > 0 > 0 > > > > reads all non-plural elements fine. when i change > AgentStatementLineVO to non-plural (regular getter/setter for the > object) it works fine as well. > > Thanks, > > Matt > Tim O'Brien wrote: > >> Could you send the complete code you are using to read with? >> >> Tim >> >> -----Original Message----- >> From: Matt Goodwin [mailto:mgoodwin@metalexis.com] >> Sent: Thu 1/13/2005 2:58 PM >> To: Jakarta Commons Users List >> Subject: Re: [betwixt] Collection property question >> I have that set. It appears that my class is not being recognized in >> the parse process. My add method on my class is never called. >> >> Matt >> >> >> Jason Wood wrote: >> >> >>> I think you want this ... >>> >>> IntrospectionConfiguration.setWrapCollectionsInElement(false) >>> >>> Jason >>> >>> -----Original Message----- >>> From: Matt Goodwin [mailto:mgoodwin@metalexis.com] >>> Sent: Thursday, January 13, 2005 11:02 AM >>> To: Jakarta Commons Users List >>> Subject: [betwixt] Collection property question >>> >>> >>> I have xml I need to map to my bean. It is very similar to the >>> CustomerBean example, except I am using Collection instead of and >>> array of objects (i.e. Order[]). Here is a sample of the xml, >>> followed by my class, followed by my .betwixt file. The problem I >>> am having is the List is always null. How do you map objects in the >>> .betwixt file if the collection has no surrounding element tag (i.e. >>> )? >>> >>> Example xml: >>> >>> 2004/10/08 >>> ... >>> ... >>> ... >>> ... >>> >>> >>> Class: >>> public class AgentStatement implements java.io.Serializable { >>> private Date statementDate; >>> private AgentInfo agentInfo; >>> private Collection agentStatementDetails = new >>> java.util.ArrayList(); >>> private AgentEarning agentEarning; >>> /* .. snip non-relevant getters/setters */ >>> public Collection getAgentStatementDetails() { >>> return agentStatementDetails; >>> } >>> public void setAgentStatementDetails(Collection >>> agentStatementDetails) { >>> this.agentStatementDetails = agentStatementDetails; >>> } >>> public void addAgentStatementDetail(AgentStatementDetail >>> agentStatementDetail) { >>> this.agentStatementDetails.add(agentStatementDetail); >>> } >>> } >>> >>> Betwixt file: >>> >>> >>> >>> >>> >>> >> property='agentStatementDetails' >>> class='com.equitrust.commissionloader.beans.AgentStatementDetail'/> >>> >>> >>> >>> >>> Everything except the agentStatementDetails are populated correctly. >>> >>> Thanks, >>> >>> Matt >>> >>> >>> >> >> >> ---------------------------------------------------------------------- >> -- >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: commons-user-help@jakarta.apache.org >> > > -- > Matt Goodwin > mgoodwin@metalexis.com > (515)708-0114 > Metalexis > "Transcending the Ordinary" > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org