On 3/28/06, Stephen Bash <[EMAIL PROTECTED]> wrote:
Dan-
Have you tried using set-method="%1" (Castor XML Mapping page)? Since
you're access the fields via a another object, I'm skeptical it would
work, but it might. Another option might be to use a valueOf method
to create your Wrapper class (see the last tip on the Castor XML
Mapping page), and finally I think the brute force method would be to
use a custom handler (also documented at the Castor website).
Unfortunately I don't have direct experience with this situation, but
those were the few thoughts I had.
Stephen
Stephen, thanks for the suggestions. I've tried using the constructor args but these seem to refer to the wrong object. As for the custom handler, I'm not sure how this would work. You can't set the two fields individually because the class is immutable, they have to be set via the constructor at the same time. You could work around it by creating a wrapper when you set the first field and then replacing it with a new wrapper instance when you set the second field, but this does not appear to be possible using the FieldHandler API.
Dan.

