When I try to assign an attribute nameto XmlElementfor JAXB, I get an error in Eclipse:
The attribute name is undefined for the annotation type XmlElement
An example of my model class:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Components {
Component component;
@XmlElement(name = "component")
public void setComponent(Component component) {
this.component = component;
}
}
I am trying to use this answer .
source
share