commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian <nospam...@gmx.net>
Subject Re: Betwixt: Setting up BeanWriter to render a bean property as attribute rather than element
Date Wed, 04 Feb 2004 15:29:10 GMT
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


Mime
View raw message