Hi Jörg,
I've test it and it's ok with arrays, but with java types doesn't work
(String, Long, Boolean,...). Example:
ResultBean<String> prueba = new ResultBean<>() ;
prueba.setBean("Hola mundo");
System.out.println(xsJson.toXML(prueba));
{"@id": "1","cod": -1,"msg": "Error","success": false,"bean":
{"@class": "string","$": "Hola mundo"}}
But with an object that don't use generics it works great:
ResultTest prueba2 = new ResultTest();
prueba2.setBean("hola mundo");
System.out.println(xsJson.toXML(prueba2));
{"@id": "1","bean": "hola mundo"}
Can I do something to solve it?
I'm using this code to initialize xstream:
XStream xsJson = new XStream(
new JsonHierarchicalStreamDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer
writer) {
return new JsonWriter(writer,
JsonWriter.DROP_ROOT_MODE, new JsonWriter.Format(
new char[0],
new char[0],
JsonWriter.Format.SPACE_AFTER_LABEL |
JsonWriter.Format.COMPACT_EMPTY_ELEMENT
));
}
});
xsJson.setMode(XStream.ID_REFERENCES);
xsJson.autodetectAnnotations(true);
Lot of thanks,
Marcial Atiénzar
On 21/03/12 19:14, Jörg Schaible wrote:
Hi Marcial,
Atienzar Navarro, Marcial wrote:
Hi,
I see XSTR-696 as resolved in trunk. How can I test it
without
compile all project? Can I use an snapshot maven version in
my project
to test it?
I've deployed a new SNAPSHOT to the Codehaus' snapshot repository. See
download links.
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
--
Marcial Atiénzar Navarro
Analista de Sistemas de Información
Avda. Del Reial Monestir Ntra. Sra. Poblet, 20
46930-Quart de Poblet (Valencia)
Tel.: 961 849 249 (corto 1249)
Móvil: 629 201 240 (corto 44249)
Fax: 961 525 321
[email protected] <mailto:[email protected]>
www.umivale.es
www.sumaintermutual.es
________________________________
Antes de imprimir cualquier documento, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
El presente mensaje y los documentos que,en su caso, lleve anexos, pueden
contener información confidencial. Se informa a quién lo reciba por error, que
su uso no autorizado está prohibido legalmente. Comunique dicha situación por
la misma vía o telefónicamente al 902 365 012, no lo remita a terceros y
proceda a su eliminación inmediata.
<<inline: logotipo.png>>
<<inline: efqm.jpg>>
