Menu

JAXBElement generic type in dozer mapping

Help
Raja
2013-03-07
2013-05-13
  • Raja

    Raja - 2013-03-07

    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

     

Log in to post a comment.