How do I get the object from JAXBElement<Object>

Viewed 13193

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....

1 Answers

You need to use the getValue() method.

 JAXBElement<ArrayOfLeadRecord> r = l.getLeadRecordList() ;
 List<LeadRecordList> leadRecordList = r.getValue().getLeadRecordList();
Related