commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [betwixt] 1.0 beta dev Object <-> String conversion
Date Mon, 08 Sep 2003 19:15:43 GMT
hi daniel

(looks like you've been a bit unfortunate in hitting another feature which 
is under construction.)

the object <-> string stuff committed recently is only part of a bigger 
whole. you need the stuff that is still hanging around on my machine 
awaiting sufficient time for me to tidy it up, document, write test cases 
and then commit it.

there is good news and bad news about the ETA of this material. the good 
news is that i've nearly finished the ASF stuff i was working on and will 
probably be back on betwixt sometime soonish, the bad news is that my plan 
is to complete the read refactoring (which will hopefully solve your other 
issue) before i go back to this.

until i manage to get these features in, your best course might be to use 
the workaround you suggested.

- robert

On Thursday, September 4, 2003, at 01:13 AM, Daniel McAllansmith wrote:

> Hello all,
>
> the ability to do custom Object<->String conversion  provided in the beta
> looks really useful, unfortunately I'm having some trouble getting it
> working...
>
> Given a bean class, TestBean, with getLocale() and setLocale(Locale) 
> methods I
> thought it would be sufficient to add
> beanWriter.getBindingConfiguration().setObjectStringConverter(new
> LocaleConverter())
> before writing out the TestBean instance to get my LocaleConverter used.
>
> This doesn't seem to be the case.
> LocaleConverter.objectToString(..) is not called.
> However if I add getName() setName(String) to TestBean then 
> LocaleConverter is
> called upon to convert the name (but still not the locale).
> (BTW: LocaleConverter has nothing to do with the one in beanutils.)
>
> Digging through the code it seems that I can hack XmlHelperUtils to change
> what types are considered as primitives so that an ElementDescriptor is 
> not
> created and the converter is used instead.  This seems a bit dodgy for 
> Locale
> and _real_ dodgy for non java classes.
>
> Am I blind?  Is there a better way?
>
> Thanks
> Daniel
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message