在java中编组/解组此xml文件的等效类是什么?
<display-type>
<value default="true">Document</value>
<value>GenericNode:144</value>
</display-type>
答案 0 :(得分:0)
@XmlRootElement(name = DisplayType.DISPLAY_TYPE)
@XmlAccessorType(XmlAccessType.NONE)
public class DisplayType {
static final String DISPLAY_TYPE = "display-type";
private static final String DEFAULT = "default";
@XmlAttribute(name = DEFAULT)
private Boolean defaultName;
@XmlValue
private String name;
}