I have such xml, and I want to read it to POJO. How can I create POJO without read the attributes: Admin, time, dirtyId ..? Which json annotations should I add (the code written in Java)?
<response status="success" code="19">
<result total-count="1" count="1">
<rules admin="admin" dirtyId="39" time="2017/05/28 11:35:18">
<entry name="Shared" admin="admin" dirtyId="33" time="2017/04/03 15:24:03">
<source admin="admin" dirtyId="33" time="2017/04/03 15:24:03">
<member admin="admin" dirtyId="33" time="2017/04/03 15:24:03">ip-10.30.14.14</member>
</source>
<destination admin="admin" dirtyId="33" time="2017/04/03 15:24:03">
<member admin="admin" dirtyId="33" time="2017/04/03 15:24:03">ip-10.30.14.25</member>
</destination>
</entry>
</rules>
</result>
This is the POJO represent the entry in xml:
public class PanoramaRule {
private PanoramaRuleOptions option;
private String name;
private List<String> to;
private List<String> from;
private List<String> source;
private List<String> destination;
@JsonProperty("source-user")
private List<String> sourceUser;
private List<String> category;
private List<String> application;
private List<String> service;
@JsonProperty("hip-profiles")
private List<String> hipProfiles;
private String action;
private String description;
private Boolean disabled;
public void setDisabled(String disabled) {
this.disabled = "yes".equals(disabled);
}
}
Thanks, Michal