Hi,
Thanks for the code.
Taking a look at this, I don't believe that it forms a core part of
what Joda-Time itself is trying to achieve - a better datetime library
for Java. It would certainly fit in the contrib area if you were
willing to code it up with tests, website and release. Or you might
find that someone else on the list is interested too :-)
Stephen
On 13/11/06, Kenny MacLeod <[EMAIL PROTECTED]> wrote:
> An example would be:
>
> package org.joda.time;
> public class PeriodPropertyEditor extends PropertyEditorSupport {
> public void setAsText(String text) throws IllegalArgumentException {
> Period period = new Period(text);
> setValue(period);
> }
> }
>
> Pretty basic. DateTime is equally easy, although Duration poses a
> slight problem, since it can only accept Strings of the form PTxMyS,
> with no support for hours or days. But that's no big deal. You may
> want to use more sophisticated string-to-type conversions in some cases.
>
> In terms of Spring usage, you would be able to have a bean with a
> property of a Joda-Time type, which spring would coerce via the custom
> editor
>
> public class MyBean
> void setPeriod(Period p) {
> ...
> }
> }
>
> <beans>
> <bean
> class="org.springframework.beans.factory.config.CustomEditorConfigurer">
> <property name="customEditors">
> <map>
> <entry key="org.joda.time.Period">
> <bean class="org.joda.time.PeriodPropertyEditor"/>
> </entry>
> </map>
> </property>
> </bean>
>
> <bean class="MyBean">
> <property name="period" value="PT60S"/>
> </bean>
> </beans>
>
>
> This could be a candidate fore the joda-time contrib section, but given
> that it has no non-JRE dependencies, it could be rolled into the main
> joda-time distro. The property editor framework also applies to
> AWT/Spring frameworks.
>
>
> kenny
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest