我想对XmlElement发表评论。
我有一个XmlType:
@XmlType(name = "Person")
使用某些XmlElements:
@XmlElement(name = "Name", required = true)
protected String name;
@XmlElement(name = "MiddleName", required = false)
protected String middleName;
@XmlElement(name = "Surname", required = true)
protected String surname;
@XmlElement(name = "UserReference", required = true)
protected String userReference;
我想在评论中提出不需要的元素。
欲望输出:
<Person>
<Name>Anthony</Name>
<!--MiddleName>Jack</MiddleName-->
<Surname>Smith</Surname>
<UserReference>741098871125866</UserReference>
</Person>
有人知道是否有一个属性或类似的东西要说JAXB将XmlElement写成注释?