I am trying to covert a domain object to JAXB object using dozer mapping. The JAXB object type is JAXBElement<SearchRequest>. How can we perform the dozer mapping for the generic type.
But I am facing ClassCastException. If I modify the code as (JAXBElement<T>)dozerMapper.map(request, Class.forName("JAXBElement<SearchRequest>")); I am getting the error as unable to find the class JAXBElement<SearchRequest>.
Please clarify me how can we use the JAXBElement generic type in dozer mapping.
Thanks,
Raja
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to covert a domain object to JAXB object using dozer mapping. The JAXB object type is JAXBElement<SearchRequest>. How can we perform the dozer mapping for the generic type.
My code looks like
(JAXBElement<T>)dozerMapper.map(request, Class.forName("SearchRequest"));
But I am facing ClassCastException. If I modify the code as (JAXBElement<T>)dozerMapper.map(request, Class.forName("JAXBElement<SearchRequest>")); I am getting the error as unable to find the class JAXBElement<SearchRequest>.
Please clarify me how can we use the JAXBElement generic type in dozer mapping.
Thanks,
Raja
I just create a new pull-request thats resolve this issue, look at:
https://github.com/DozerMapper/dozer/pull/101
or review this in my personal fork, at:
https://github.com/pepebarragan/dozer