需要帮助:以下 XmlJavaTypeAdapter 类型无法正常工作:
public class TestAdapter extends XmlAdapter<Object, Object> {
public Object marshal(Object arg0) throws Exception {
System.out.println("Test Adapter");
return null;
}
public Object unmarshal(Object arg0) throws Exception {
System.out.println("Test Adapter");
return null;
}
}
我正在使用“TestAdapter”,例如:
'@XmlRootElement
@XmlJavaTypeAdapter(value = TestAdapter.class)
public TestClass{...}'
但我面临的问题是“TestAdapter”永远不会被调用。