I have the follwoing xml element:
text B inner text text B
You can use a combination of @XmlAnyElement and @XmlMixed to achieve this:
import java.util.List;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="FIELD1")
public class Root {
protected List<Object> compOrValue;
@XmlAnyElement
@XmlMixed
public List<Object> getCompOrValue() {
return compOrValue;
}
public void setCompOrValue(List<Object> compOrValue) {
this.compOrValue = compOrValue;
}
}