I have the following XML schema:
<Courses semester="1">
<Course code="A231" credits="3">Intermediate A</Course>
<Course code="A105" credits="2">Intro to A</Course>
<Course code="B358" credits="4">Advanced B</Course>
</Courses>
I need to convert this into POJO as:
public class Schedule
{
public int semester;
public Course[] courses;
}
public class Course
{
public String code;
public int credits;
public String name;
}
There are two important things to note here:
- The courses object are not wrapped in a tag
- Some of the properties are attributes
How do I need to annotate my objects to get FasterXML to deserialize this xml?
@JacksonXmlText
is no more available on most recent jackson library if I am not wrong. Do you know how to proceed? – Hawse