Spring MVC 3.0: Avoiding explicit JAXBElement<> wrapper in method arg

Posted by Keith Myers on Stack Overflow See other posts from Stack Overflow or by Keith Myers
Published on 2010-04-23T18:40:41Z Indexed on 2010/04/23 18:43 UTC
Read the original article Hit count: 287

Filed under:
|
|
|

I have the following method and want to avoid having to explicitly show the JAXBElement<> syntax. Is there some sort of annotation that would allow the method to appear to accept raw MessageResponse objects but in actuality work the same as shown below? I'm not sure how clear that was so I'll say this: I'm looking for some syntactic sugar :)

    @ServiceActivator
public void handleMessageResponse(JAXBElement<MessageResponse> jaxbResponse) {
    MessageResponse response = jaxbResponse.getValue();
    MessageStatus status = messageStatusDao.getByStoreIdAndMessageId(response.getStoreId(), response.getMessageId());
    status.setStatusTimestamp(response.getDate());
    status.setStatus("Complete");
}

© Stack Overflow or respective owner

Related posts about spring

Related posts about mvc