我有这样的XML:
*<link:label xlink:type="resource"
xlink:label="label"
xlink:role="http://www.xbrl.org/2003/role/label"
xlink:title="title" xml:lang="en" id="label_id">
Firm's symbol</link:label>*
我的域名中有三个班级:
1:标签
@XmlRootElement(name = "label",namespace = "http://www.xbrl.org/2003/linkbase")
public class Label extends Resource {
@Column(name = "value")
private String value;
public Label() {
}
@XmlValue
public String getValue() {
return value;
}
2:资源
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Resource extends ExtendedLinkElement {
private String id_resource;
private String label;
private String role;
private String title;
private String type;
public Resource() {
}
}
@XmlAttribute( name = "label",namespace = "http://www.w3.org/1999/xlink")
public String getLabel() {
return label;
}
@XmlAttribute( name = "role",namespace = "http://www.w3.org/1999/xlink")
public String getRole() {
return role;
}
@XmlAttribute( name = "title",namespace = "http://www.w3.org/1999/xlink")
public String getTitle() {
return title;
}
@XmlAttribute( name = "type",namespace = "http://www.w3.org/1999/xlink")
public String getType() {
return type;
}
3:ExtendedLinkElement
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class ExtendedLinkElement {
@Id
@Column(name = "ID")
private Long id;
public ExtendedLinkElement() {
}
但是在xml
文件的解组中我得到了这个错误:
属性或字段值无法使用XmlValue
进行注释,因为它是另一个XML绑定类的子类
我使用moxy for jaxb RI,当我使用@xmlMixed
时,在我的属性中返回null。