1.

What Limitations Has Xstream's Json Support?

Answer»

JSON represents a very simple data model for easy data transfer. Especially it has no equivalent for XML attributes. Those are written with a leading "@" character, but this is not always possible without violating the syntax (e.g. for array types). Those may silently dropped (and makes it therefore DIFFICULT to implement deserialization). References are ANOTHER issue in the serialized object graph, since JSON has no possibility to EXPRESS such a construct. You should therefore always set the NO_REFERENCES mode of XStream. Additionally you cannot USE implicit collections, since the properties in a JSON object must have UNIQUE names.

JSON represents a very simple data model for easy data transfer. Especially it has no equivalent for XML attributes. Those are written with a leading "@" character, but this is not always possible without violating the syntax (e.g. for array types). Those may silently dropped (and makes it therefore difficult to implement deserialization). References are another issue in the serialized object graph, since JSON has no possibility to express such a construct. You should therefore always set the NO_REFERENCES mode of XStream. Additionally you cannot use implicit collections, since the properties in a JSON object must have unique names.



Discussion

No Comment Found