相关疑难解决方法(0)

将JAXB与Google Android配合使用

我需要解析通过xml传递的java对象.我想为这些目的使用JAXB框架,因为我已预先注释(使用JAXB)java-class.

这原则上可行吗?

InputStream input = entity.getContent();
JAXBContext jc = JAXBContext.newInstance(new Class[] {Response.LoginResponse.class});
Unmarshaller un = jc.createUnmarshaller();
LoginResponse response = (LoginResponse)un.unmarshal(input);
Run Code Online (Sandbox Code Playgroud)

在第4行,我有一个警告:"无法解析静态方法282 JAXBContext ..."然后VM崩​​溃

关于如何解决这个问题的任何想法?

android jaxb

30
推荐指数
2
解决办法
4万
查看次数

标签 统计

android ×1

jaxb ×1