本文介紹了JAXB 文檔注釋的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我有以下帶有 JAXB @XMLRootElement 注釋的 java 類
I have the following java class with the JAXB @XMLRootElement annotation
@XmlRootElement(name="ClientData")
public class ClientData {
/**
* The first address field of the person
*/
private String address1 = null;
}
當(dāng)我生成 xsd 架構(gòu)時(shí)會(huì)生成這個(gè) xml 片段
which produces this xml fragment when i generate the xsd schema
<xs:complexType name="clientData">
<xs:sequence>
<xs:element minOccurs="0" name="address1" type="xs:string"/>
是否可以使用 JAXB 注釋,以便將 address1 字段的文檔詳細(xì)信息作為 xs:annotation/xs:documentention 元素包含在我的最終模式中?
Is it possible to use a JAXB annotation so that the documentation details on the address1 field will be included as a xs:annotation/xs:documentention element in my final schema?
<xs:complexType name="clientData">
<xs:sequence>
<xs:element minOccurs="0" name="address1" type="xs:string">
<xs:annotation>
<xs:documentation>The first address field of the person</xs:documentation>
</xs:annotation>
</xs:element>
推薦答案
簡(jiǎn)單的回答:不,使用內(nèi)置 JAXB 是不可能的.
Simple answer: no it's not possible with builtin JAXB.
這篇關(guān)于JAXB 文檔注釋的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!