Paul, Please see inline ....
Werner > -----Ursprüngliche Nachricht----- > Von: philion [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 12. April 2007 01:54 > An: castor > Betreff: [castor-user] [XML] Marshal-only using get-method? > > I have a XML mapping that I would like to make sure is only used for > marshaling (and specifically not unmarshaling). I had thought that I > could use "get-method" for a specific field, then Castor ignores that > field during the unmarshaling process. For the most part, it looks > like this is true (the setter is never called), but the object in > question is still constructed (which I would like to avoid for > efficiency). > > If I mark the field as "transient", then it is ignored completely, but > it is never marshaled! Yes, that is correct. As Castor has two sides (XML and JDO), this allows the user to selectively turn on/off one of these worlds. > Is there a way to avoid this (I am happy to tweak code an submit a > fix, but I can't find where to make the change), or am I stuck with > the behavior? Well, yes and no. Currently, you are stuck, as the transient attribute does not distinguish whether you are marshalling or unmarshalling. But in my view it should be quite easy to add e.g. two new attributes to the <bind-xml/> element to allow configuration fo this behavior. This would require a change to the mapping.xsd/mapping.dtd files, re-generation of the Java classes for the mapping file, and some code tweaks in selected areas. I'd be more than willing to help you with some fo these activities and give you some guidance. > > Thanks, > > - Paul > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

