我使用的是JCAPS5.1.3,只有Java1.4,并且需要处理Json数据。不幸的是,我发现的所有库都使用Java1.5和更高版本。我刚刚在这个线程中发现了许多新的实现,但是哪一个与1.4一起工作。
是否有一个稳定和简单的版本可与Java1.4一起使用?
发布于 2013-06-24 20:44:59
Xstream 1.2.2支持Java1.4。这是我发现的唯一支持Java1.4的库。不过,它肯定有疣。
发布于 2013-03-19 15:09:16
另一种方法是使用Retroweaver使jar与Java1.4兼容:
http://retroweaver.sourceforge.net
发布于 2016-02-23 21:07:23
您可以使用我的json图书馆。它支持编组和解编组到类(有一些限制)和解析。
编组:
Knight knight = new Knight();
knight.name = "Lancelot";
knight.weapon = new Weapon();
knight.weapon.metal = "true silver";
knight.weapon.name = "piercer";
knight.rank = 2;
knight.titles = new String[] { "noble", "round table member" };
Land goldshire = new Land();
goldshire.name = "GoldShire";
goldshire.surface = 45532.3;
Land direwood = new Land();
direwood.name = "Direwood";
direwood.surface = 472;
knight.lands = new Land[] { goldshire, direwood };
System.out.println("Test 1 : marshall simple class:");
String generated = JsonFactory.marshal(knight).toString();解编组:
Knight knight = (Knight) JsonFactory.unmarshal(new FileTools().readFile("UnmarshallingTest1.json"), Knight.class);https://stackoverflow.com/questions/15501258
复制相似问题