Is there any way to just ignore an element from Jaxb parsing? I have a large XML file, and if I could ignore one of the large, complex elements, then it would probably parse
All what you need it's mark field as @XmlTransient (@XmlTransient annotation which should hide fields that are not required). Example below
JavaEE:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "DeletedIds")
public class DeletedIds {
@XmlElement(name = "DeletedId")
private List id;
@XmlTransient
@XmlElement(name = "success")
private String success;
//getters&setters
}
@XmlAccessorType(XmlAccessType.FIELD)
public class DeletedId {
private int id;
//getters&setters
}
Xml:
1
2