是否有其他方法而不必使用JSONObject?
我的代码:(到目前为止我尝试过的)
@Path("rdescriptions")
@GET
@Produces("application/json")
public RSet getRDescriptions() throws JAXBException {
File file = new File("../RSet.xml");
JAXBContext jaxbContext = JAXBContext.newInstance(RSet.class);
Unmarshaller um = jaxbContext.createUnmarshaller();
RSet rs = (RSet) um.unmarshal(file);
return rs;
}
json that gets generated:
"Rule":[{"ID":"t1","desc":"Something","order":1,"result":{"com":0,"no":
{"word":[{}]}},"we":{"T":[{"set":0,"IS":{"v":{"EF":[{}]}}}]}},
{"ID":"t2","desc":"Html","order":1...]
我想只提取每个ID。有人可以解释一下如何做到这一点吗?