JAXB Marshalling - extending an existing class

好久不见. 提交于 2019-12-03 16:26:17

That is very simple: you need to to create a JAXB binding file with following contents:

<jaxb:bindings version="1.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>

    <jaxb:globalBindings>
        <!-- All beans should extend this base class: -->
        <xjc:superClass name="org.mycompany.common.Bird" />
    </jaxb:globalBindings>

</jaxb:bindings>

More information on this option (and other sweet things) you can find here.

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