Xml 瞬态注释不适用于以下模型-
@XmlRootElement
public class JdfValidation {
private String name;
private String dataType;
private String errorMessage;
private String javaValidationLogic;
protected String displayName;
private boolean isCustom;
private List<ValidationInputParam> validationInputParams = new ArrayList<ValidationInputParam>();
public IFile container;
public JdfValidation() {
}
public JdfValidation(String name, String displayName, boolean isCustom) {
this.name = name;
this.displayName = displayName;
this.isCustom = isCustom;
}
@XmlTransient
public IFile getContainer() {
return container;
}
public void setContainer(IFile container) {
this.container = container;
}
/**
* @return the validationInputParams
*/
@XmlElement
public List<ValidationInputParam> getValidationInputParams() {
return validationInputParams;
}
/**
* @param validationInputParams
* the validationInputParams to set
*/
public void setValidationInputParams(
List<ValidationInputParam> validationInputParams) {
this.validationInputParams = validationInputParams;
}
@XmlAttribute
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@XmlAttribute
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
@XmlAttribute
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
@XmlElement(name = "logic")
public String getJavaValidationLogic() {
return javaValidationLogic;
}
public void setJavaValidationLogic(String javaValidationLogic) {
this.javaValidationLogic = javaValidationLogic;
}
@XmlAttribute
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@XmlAttribute
public boolean isCustom() {
return isCustom;
}
public void setCustom(boolean isCustom) {
this.isCustom = isCustom;
}
}
我还尝试了@XmlAccessorType(XmlAccessType.NONE) bu 仍然是相同的异常,以上适用于默认的 jaxb 实现。请帮助。
引起:异常[EclipseLink-50089](Eclipse Persistence Services - 2.5.0.v20130507-3faac2b):org.eclipse.persistence.exceptions.JAXBException 异常描述:java接口org.eclipse.core.resources.IFile不能由 JAXB 映射,因为它有多个可映射的父接口。不支持多重继承