我在 JAXB 生成的类中有以下注释
@XmlType(name = "MessageInfoType", propOrder = {
"debugTraceBoolean",
"clientHostnameString",
"endUserIPAddress"
})
需要在具有自定义绑定的 JAXB 类中生成以下注释。即需要编辑上述注释并使用 annox 添加命名空间,如下所示。
@XmlType(name = "MessageInfoType", propOrder = {
"debugTraceBoolean",
"clientHostnameString",
"endUserIPAddress"
}, namespace="urn:expedia:e3:data:messagetypes:defn:v4")
我的 xjb 文件是:
<jaxb:bindings schemaLocation="../../serviceDescription/atlantis/common/com.expedia.e3.data.messagetypes.v4.xsd">
<jaxb:bindings node="//xs:complexType[@name='MessageInfoType']">
<annox:annotate target="field">
<annox:annotate annox:class="javax.xml.bind.annotation.XmlType"
namespace="urn:expedia:e3:data:messagetypes:defn:v4"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>