From commons-dev-return-651-qmlist-jakarta-archive-commons-dev=jakarta.apache.org@jakarta.apache.org Fri Nov 02 18:19:57 2001 Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 19891 invoked from network); 2 Nov 2001 18:19:57 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 2 Nov 2001 18:19:57 -0000 Received: (qmail 8497 invoked from network); 2 Nov 2001 18:22:16 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 2 Nov 2001 18:22:16 -0000 Received: (qmail 15381 invoked by uid 97); 2 Nov 2001 18:19:56 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 15331 invoked by uid 97); 2 Nov 2001 18:19:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 15320 invoked from network); 2 Nov 2001 18:19:55 -0000 Message-ID: <004f01c163ca$f8dc3810$210e10ac@mobileum.com> From: "Scott Sanders" To: "Jakarta Commons Developers List" References: <20011102094911.D81177-100000@localhost> Subject: Re: earth to digester Date: Fri, 2 Nov 2001 10:19:55 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 X-OriginalArrivalTime: 02 Nov 2001 18:12:40.0795 (UTC) FILETIME=[F5E2EAB0:01C163C9] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > > Are you saying you want Castor's capabilities, at least on the XML->Java > > > side? > > > > I don't know exactly what Castor does, I've only looked at it for an hour. > > > > > Something like on an element, try to find an attribute on the object at the > > > top of the stack that corresponds by name to that element, and set the > > > attribute appropriately? > > > > The XML documents would probably have to attributes, all elements: > > > > > > value1 > > value2 > > > > > > and > > > > bean.setAttribute1(value1) > > bean.setAttribute2(value2) > > > > would be called. it obviously will get more complicated with nested elements > > but that's the general idea. > > > > You can actually do this with Digester today: > > digester.addObjectCreate("bean", "com.mycompany.MyClass"); > digester.addCallMethod("bean/attribute1", "setAttribute1", 0); > digester.addCallMethod("bean/attribute2", "setAttribute2", 0); > > The "zero parameters" value is a (sort of) kludge that says "take the > actual parameter value from the body of this element". > > It might be more concise to add some sort of a rule to make this easier to > say, perhaps: > > digester.addBeanPropertySetter("bean/attribute1"); > digester.addBeanPropertySetter("bean/attribute2"); > > that would infer the property name from the final element of the matching > pattern, but it would be functionally equivalent to the existing > capability. > > Yes, he could do that, but I thought he was saying that he wanted Digester to 'just know' to set the attribute, i.e. without defining specific rules. Which way were you looking for Jason? Scott -- To unsubscribe, e-mail: For additional commands, e-mail: