I have following xml response from web service which need to map to java class.
06/24/2016 07:45:10
xyz
1
ABC
06/06/2016
2
PQR
06/06/2016
I have mapping class like
class api1Response{
String timeStamp;
String ippProjectName;
//how to map project
}
As project tags not having any parent element how i can map it to List using jaxb.
I know it will be easy if "project" tags having parent elements like "projects" but response is not in my control and i still need to parse it with jaxb.
解决方案
Just using XmlElement over a list of projects shoud do the trick :
class api1Response{
String timeStamp;
String ippProjectName;
@XmlElement(name="project")
List projects;
}