Sunday, August 31, 2008

XStream Deserialization

When calling XStream.fromXML() to deserialize an object, XStream by default will use ReflectionConverter to populate the fields of the given root object instead of instantiating a new one. To force instantiation of a new object, use

XStream xstream = XStream(new PureJavaReflectionProvider());

No comments: