commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simon <simon.kitch...@chello.at>
Subject Re: $$$ [Digester] Converting String do java.util.Date $$$
Date Fri, 19 Oct 2007 20:27:32 GMT
On Fri, 2007-10-19 at 17:10 -0300, Romualdo Rubens de Freitas wrote:
> Hi Simon,
> 
> Thanks a lot for your quick answer.
> 
> Yes, I was debugging Digester source code to see where my XML document was
> failing and I've found that code at
> org.apache.commons.beanutils.converters.DateTimeConverter.convertToType()
> method.
> 
> As I said that method has an if statement with the boolean condition:
> useLocaleFormat
> 
> Your tip is cool, I can register my own conversion object, but I think
> it's possible to
> configure the conversion made by BeanUtils so that my date format can
> be recognized as
> BeanUtils docs state, but I don't know how nor where 'cause this
> configuration must be
> made with Digester (I think).
> 
> Can you help with date contents in XML elements/attributes, too ???

At least in earlier releases, BeanUtils deliberately did NOT register a
date converter object because there are so many different date formats,
and no obvious "standard" one. 

I vaguely remember something about the very latest BeanUtils release and
dates; maybe this has changed. I suggest checking the release notes.

But for further info about setting up BeanUtils I suggest you post a new
email with [beanutils] in the subject, rather than digester. Configuring
this is nothing to do with Digester at all - as I said, Digester calls
ConvertUtils.convert, and that is all it does. What happens then is up
to the beanutils library.

Exactly the same logic applies to both element-body-text and attributes;
BeanUtils handles all converting, using the singleton objects that are
accessed via the static beanutils methods. And those are configured by
calling beanutils static methods, not via digester.

 Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message