Yevhen Yaremchuk opened SPR-6939 and commented
When using XStreamMarshaller for serializing object to JSON by customizing StreamDriver to skip root node resulting in empty output. Configuration of StreamDriver illustrated by the following snapshot
final XStreamMarshaller marshaller = new XStreamMarshaller();
marshaller.setStreamDriver(new JsonHierarchicalStreamDriver() {
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE);
}
});
At the same time using XSTream directly works just fine.
final XStream xStream = new XStream(new JsonHierarchicalStreamDriver() {
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE);
}
});
Affects: 3.0 GA
Referenced from: commits ac9a625