Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the object from JAXBElement<Object>

Tags:

java

xml

I have :

JAXBElement<ArrayOfLeadRecord> r = l.getLeadRecordList() ;

How can I get the actual ArrayOfLeadRecord as an object? It took me so long to unmarshal/convert this JAXBElement to the actual object I want.
Thanks a lot....

like image 988
user3059707 Avatar asked Dec 04 '13 05:12

user3059707


1 Answers

You need to use the getValue() method.

 JAXBElement<ArrayOfLeadRecord> r = l.getLeadRecordList() ;
 List<LeadRecordList> leadRecordList = r.getValue().getLeadRecordList();
like image 125
radimpe Avatar answered Sep 30 '22 04:09

radimpe