Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 21748 invoked from network); 5 May 2004 19:59:49 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 May 2004 19:59:49 -0000 Received: (qmail 85749 invoked by uid 500); 5 May 2004 19:59:31 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 85733 invoked by uid 500); 5 May 2004 19:59:31 -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 85652 invoked from network); 5 May 2004 19:59:31 -0000 Received: from unknown (HELO smtp-out6.blueyonder.co.uk) (195.188.213.9) by daedalus.apache.org with SMTP; 5 May 2004 19:59:31 -0000 Received: from [10.0.0.2] ([82.38.65.173]) by smtp-out6.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Wed, 5 May 2004 20:59:38 +0100 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <40988550.9080705@lawlex.com.au> References: <40988550.9080705@lawlex.com.au> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: robert burrell donkin Subject: Re: [betwixt] WrapCollectionsInElement ignored when element is specified in .betwixt file Date: Wed, 5 May 2004 20:59:31 +0100 To: "Jakarta Commons Users List" X-Mailer: Apple Mail (2.613) X-OriginalArrivalTime: 05 May 2004 19:59:38.0327 (UTC) FILETIME=[7F01D670:01C432DB] 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 George i know that this probably isn't very intuitive but the wrapping only effects those elements which are added automatically. the idea is that you can easily add wrapper elements in a betwixt file. (i think that this is explain in http://jakarta.apache.org/commons/betwixt/guide/binding.html - if it isn't then please let me know or even better contribute a patch :) BTW ordering is something that was always intended to be a pluggable strategy. maybe something like public abstract class ElementDescriptorOrderer /** * Provides ordering for the child elements of the given descriptor. * @param descriptor ElementDescriptor, not null * @return Comparator (for ElementDescriptors) to order the given descriptor */ public abstract Comparator order(ElementDescriptor descriptor); the idea is that towards the end of the introspection, the strategy would be called and the descriptors re-ordered. comments anyone? even better, any volunteers to have a go at an implementation? (it's easy, i promise but it's now critical that beanutils and digester are sorted out ready for their next releases so those components are going to be my priority over the next few days.) - robert On 5 May 2004, at 07:10, George Papastamatopoulos wrote: > Hi > > Im having some troubles that hopefully someone can help me with. I > have a bean that I'm converting to xml, but want to control the order > of the xml elements, and their names, so I've defined a .betwixt file > to do this. > > > ... > public List getMyElements() > { > return elements; > } > > > <.betwixtSnippet> > .. > > <.betwixtSnippet> > > Problem is, that when I specify the property as an element, betwixt > doesn't wrap the collection in a containing element, even though I've > specfied the wrapCollectionsInElement property to be true, but rather > renders each individual element as "". When I remove > the reference from the betwixt file, I get what I'm after (elements, > wrapped in a containing element). > > > > ... > > > Is this expected behaviour? Am I missing something? Am Im able to > define elements in the betwixt file and still get the behaviour I'm > after. > Thanks for listening. > George > > -- > ___________________________ > George Papastamatopoulos > > Lawlex Compliance Solutions > +61 3 9278 1182 > ___________________________ > > > --------------------------------------------------------------------- > 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