Werner Guttmann wrote:
> Other than opennig a Jira issue at http://jira.codehaus.org/browse/CASTOR,
> and ask us to provide those methods, no ... ;-). As I have added the one for
> Writer myself a few eeks ago, it should not be too hard .... but as always,
> patches would be welcome ... ;-).

Thinking a bit more about this, it's not obvious to me how the various set
methods should be implemented. A marshaller will only have one mapping, for
instance, but what should we expect mymarshaller.marshall(myobj) to do if both
a Writer and a Node have been set?

To me, it seems the most natural solution would be to have instance methods
which mirror the current static methods. In other words, the sink isn't a
property of the marshaller, it's just provided when the
mymarshaller.marshal(obj, sink) method is called.

What do you think? That seems natural to me (and is why I tried calling the
static methods by accident in the first place), but I'm not sure without trying
whether the static methods will prevent instance methods with the same
signature from being defined. If this seems a sane approach, and there's no
technical restriction, then I'll happily provide you with a patch :)

> PS Re: static marshal() methods .. I think they have been added for
> convenience reasons ... and somehow I wish that didn't happen myself .. ;-).

Yes, I can understand that! And so hard to remove once they're there...

Andy

-- 
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to