Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 54629 invoked from network); 4 Feb 2004 15:30:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 15:30:18 -0000 Received: (qmail 84398 invoked by uid 500); 4 Feb 2004 15:29:10 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 84323 invoked by uid 500); 4 Feb 2004 15:29:09 -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 84248 invoked from network); 4 Feb 2004 15:29:08 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by daedalus.apache.org with SMTP; 4 Feb 2004 15:29:08 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AoOxh-0003Pu-00 for ; Wed, 04 Feb 2004 16:29:10 +0100 Received: from blueice1x.uk.ibm.com ([194.196.100.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed Feb 4 15:29:10 2004 Received: from nospam_st by blueice1x.uk.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed Feb 4 15:29:10 2004 X-Injected-Via-Gmane: http://gmane.org/ To: commons-user@jakarta.apache.org From: Sebastian Subject: Re: Betwixt: Setting up BeanWriter to render a bean property as attribute rather than element Date: Wed, 04 Feb 2004 16:29:10 +0100 Lines: 45 Message-ID: References: <401BA5D6.4050307@gmx.net> <78DE608E-5699-11D8-A81E-003065DC754C@blueyonder.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: blueice1x.uk.ibm.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en In-Reply-To: <78DE608E-5699-11D8-A81E-003065DC754C@blueyonder.co.uk> Sender: news 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 robert burrell donkin wrote: > hey Sebastian > > i have some good news and some less good news: > > the good news is that i've added a pluggable strategy for binding simple > types (primitives at the moment). i hope that you should be able to > subclass the new SimpleTypeMapper class with something a litte like: > > /** Implementation binds strings to elements but everything else to > attributes */ > class StringsAsElementsSimpleTypeMapper extends SimpleTypeMapper { > > /** > * Binds strings to elements but everything else to attributes > */ > public Binding bind( > String propertyName, > Class propertyType, > IntrospectionConfiguration configuration) { > if (String.class.equals(propertyType)) { > return SimpleTypeMapper.Binding.ELEMENT; > } > return SimpleTypeMapper.Binding.ATTRIBUTE; > } > > } > > the less good news is that i needed to add it on the refactoring branch > (since the code involved on CVS HEAD has been refactored on the branch). > so you'll need to grab the REFACTORING-BRANCH_2004-01-13 version of the > source from cvs and build it yourself (probably using > http://maven.apache.org). > > i may get round to adding some documentation on it but again this will > be on the branch. > > - robert Hi Robert, thanks a lot for adding this new Mapper. A dumb question: how can I access the refactoring branch? I'm using eclipse to access the apache CVS but can't see that branch anywhere. Sebastian --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org