You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Cord Awtry <ki...@gmail.com> on 2008/06/16 21:55:32 UTC

[BeanUtils] CopyProperties with Dates

All,

  I'm using bean utils 1.7.0 (upgrading to 1.8.0 beta isn't really an
option). I'm trying to use copyProperties() where the source object's getter
is a java.util.Calendar and the destination's setter is java.util.Date. I
know that 1.8.0 BETA has new converters but does anyone know of another way
to make this work? Ignore certain properties and then set them by hand?

  Thanks,

    -Cord

Re: [BeanUtils] CopyProperties with Dates

Posted by Cord Awtry <ki...@gmail.com>.
Chris,

  Thanks. This helped a lot.

    -C-

On Mon, Jun 16, 2008 at 5:33 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Cord,
>
>
> Cord Awtry wrote:
> | I'm using bean utils 1.7.0 (upgrading to 1.8.0 beta isn't really an
> | option). I'm trying to use copyProperties() where the source object's
> getter
> | is a java.util.Calendar and the destination's setter is java.util.Date. I
> | know that 1.8.0 BETA has new converters but does anyone know of
> another way
> | to make this work? Ignore certain properties and then set them by hand?
>
> You could write your own Date -> Calendar converter.
>
> I recently wrote a String->Date/Calendar converter for parsing
> xs:dateTime formats and posted it to the list under the subject
> "[digester] implementation of String->Date for xs:dateTime". You are
> free to steal my code if it helps you.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkhW3B0ACgkQ9CaO5/Lv0PA07ACcDXzUwvquONzqjY7MEKjMHq+s
> FuUAoITUwug9k6fbTNnVPwFk/xPXqB+u
> =0e+0
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [BeanUtils] CopyProperties with Dates

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cord,

Cord Awtry wrote:
| I'm using bean utils 1.7.0 (upgrading to 1.8.0 beta isn't really an
| option). I'm trying to use copyProperties() where the source object's
getter
| is a java.util.Calendar and the destination's setter is java.util.Date. I
| know that 1.8.0 BETA has new converters but does anyone know of
another way
| to make this work? Ignore certain properties and then set them by hand?

You could write your own Date -> Calendar converter.

I recently wrote a String->Date/Calendar converter for parsing
xs:dateTime formats and posted it to the list under the subject
"[digester] implementation of String->Date for xs:dateTime". You are
free to steal my code if it helps you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhW3B0ACgkQ9CaO5/Lv0PA07ACcDXzUwvquONzqjY7MEKjMHq+s
FuUAoITUwug9k6fbTNnVPwFk/xPXqB+u
=0e+0
-----END PGP SIGNATURE-----

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