I want to know if it's possible to ignore one or many nodes when parsing XML using Jackson ML module.
I want to be able to parse this XML
<bundle>
<id value="myBundleId"/>
<meta>
<profile value="http://myurl/profile1" />
<profile value="http://myurl/profile2" />
<tag>
<system value="https://myurl/system" />
<code value="myAppCode"/>
</tag>
</meta>
<type value="message" />
</bundle>
into this POJO object
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import lombok.Data;
@Data
public class Bundle {
@JacksonXmlElementWrapper(localName = "id")
@JacksonXmlProperty(isAttribute = true, localName = "value")
private String id;
@JacksonXmlElementWrapper(localName = "type")
@JacksonXmlProperty(isAttribute = true, localName = "value")
private String type;
}
Right now it's not working as I think the annotation @JacksonXmlElementWrapper is only working with lists.
It also gives me the following error message :
java.lang.IllegalArgumentException: Conflicting setter definitions for property "value"