if I am not wrong we need to create 2 classes one for thing and other for property as follows
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {"property"})
@XmlRootElement(name = "thing")
public class Thing {
@XmlElement(required = true)
protected Property property;
public Property getProperty() {
return property;
}
public void setProperty(Property value) {
this.property = value;
}
}
and the other class will be
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "property")
public class Property {
@XmlAttribute(required = true)
protected String key;
@XmlAttribute(required = true)
protected String value;
public String getKey() {
return key;
}
public void setKey(String value) {
this.key = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}