commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [betwixt] Strategies for roundtripping Date objects
Date Tue, 01 Apr 2003 19:18:58 GMT
On Tuesday, April 1, 2003, at 05:04 PM, wrote:

> Hi all,
> I am using betwixt to take a basic object with lots of string parameters 
> and
> roundtrip them to XML and back.  However, I just added a java.util.Date
> object, and now betwixt is erroring when it tries to pass the String
> representation of the date object back in as a string.  I could add a 
> method
> public void setDate(String dateAsString)
> but that seems icky.  Do I have to create a .betwixt file to deal with 
> this?
> Or, should betwixt be changed to look at my String and try and convert it 
> to
> a date if my only matching method signature takes a date.  Alternatively 
> to
> create a .betwixt file, can I do the same thing, but programatically.  I
> don't really want to add yet another file for mapping.

i believe that betwixt uses ConvertUtils to convert stings to other things.
  so you should be able to register a Converter. if this doesn't work, then 
i'd say that this is a bug which needs to be fixed. repost and i'll take a 
look when i get the change or (if you feeling brave) create a test case 
and a patch. (i think that MethodUpdater is probably a good place to start 
looking for the bug.)

> Loving Betwixt!

don't say that too load! betwixt is cool but there's still tons of work 
that still needs to be done. any help would be gratefully received!

- robert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message