Hi Uwe, u...@codesmell.de wrote:
> Hi > > i am trying to use the DataHolder interface to record information on > marshalling and add info on unmarshalling using a custom converter. > > while this works if i use XStream.marshall/unmarshall methods, i get > NPEs if i use fromXML/toXML on the same xstream instance. > > i *thought* (that might be my misconception) that newDataHolder() was > called during toXML to create an initial DataHolder to be passed to the > converters. > > according to my eclipse and my debug-output, XStream.newDataHolder is > never called. > Am i right and this is a bug, or what do i miss ? > > is there another way of getting grips of the DataHolder being used on > unmarshalling, so that i can provider the info to it which is needed by > my converter? > > XStream version is 1.4.5/6 I am not sure, what you really want to do. The DataHolder that is used by default is created for every call to marshal/unmarshal so that the converters may communicate within one (un)marshalling process. If you provide a DataHolder yourself, you define how long this data is kept. XStream.newDataHolder is a convenience method for *you* to provide an own one, XStream does not call it. Cheers, Jörg --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email