开发者

has anyone got xmlbeans to work with GSON?

Basically as above.

Gson gson = new Gson();
ErrorsDocument er = ErrorsDocument.Factory.newInstance();
er.setError("monkey escaped");
System.out.println(gson.toJson(er));

cra开发者_高级运维ps out with:

Exception in thread "main" java.lang.IllegalStateException: How can the type variable not be present in the class declaration! at com.google.gson.TypeInfoFactory.getIndex(TypeInfoFactory.java:127) at com.google.gson.TypeInfoFactory.getActualType(TypeInfoFactory.java:93) at com.google.gson.TypeInfoFactory.getTypeInfoForField(TypeInfoFactory.java:54)

etc

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜