What is the ObjectFactory role during JAXB-Unmarshalling?

百般思念 提交于 2019-12-01 03:37:38

You can leverage the @XmlType annotation to control how the objects are created:

@XmlType(factoryClass=ObjectFactory.class, factoryMethod="createRsp")
public class Response {
}

For More Information

The ObjectFactory class generated by the XJC compiler is not useful to the factoryClass and factoryMethod @XmlType annotation because the factoryMethod must be a static no-arg method and the XJC generate instance methods.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!