I have an abstract root class, let's say A
.
And I have several implementation classes extending A
.
A
has FIELD annotation as well as some @XmlElement
annotated properties.
A
also has an abstract method.
When marshalling (B extends A
), the value returned by the abstract method gets marshalled as attribute. Not as expected, right?
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class SpecialProfile extends ContentNodeBean {
@XmlElement(name="do-index", namespace="my")
private boolean doIndex = false;
public abstract SpecialProfileType getSpecialProfileType();
... getters and setters for properties ...
}
Does anybody have the same issue and how can this be fixed?
I am using org.eclipse.persistence.moxy 2.1.2
I am attempting to reproduce your issue, but so far have been unsuccessful. Can you see where I'm doing something different than you are? The following is my sample code:
A
B
C
Demo
Output
UPDATE
Based on your comments:
The following is what class B should look like: