Jaxb - umarshaling mixed xml element with value
1 answer
To achieve this, you can use a combination of @XmlAnyElement and @XmlMixed:
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;
}
}
+3