【发布时间】:2011-08-19 13:34:46
【问题描述】:
我有一个对象列表,如下所示
List<ProductInfo>
我想使用 flex json 对其进行序列化,以便它应该喜欢
[{"product_id":"2","name":'stack"'},{"product_id":"2","name":"overflow"}]"
为了将上述字符串反序列化为对象列表,我使用以下代码
final List<ProductInformation> productInformationList = new JSONDeserializer<List<ProductInformation>>().use(null, ArrayList.class)
.use("values", ProductInformation.class).deserialize(parameterValue);
为了将对象序列化为字符串,我正在这样做,但它不起作用....我遗漏了一些东西...
final String serializizedString = new JSONSerializer().serialize(productInformationList);
我需要什么将对象序列化为字符串?
【问题讨论】:
-
你试过什么?请发布一些代码,展示您为实现目标所做的最佳尝试,并就导致错误或给您带来麻烦的部分提出具体问题...
-
@maerics : 你对 flexjson 有什么想法吗..
标签: java serialization