/** * Unmarshals the request payload of the given message context as {@link JAXBElement}. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled element, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final <T> JAXBElement<T> unmarshalElementFromRequestPayload(MessageContext messageContext, Class<T> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { JaxbElementSourceCallback<T> callback = new JaxbElementSourceCallback<T>(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled object, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final Object unmarshalFromRequestPayload(MessageContext messageContext, Class<?> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { Jaxb2SourceCallback callback = new Jaxb2SourceCallback(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled object, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final Object unmarshalFromRequestPayload(MessageContext messageContext, Class<?> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { Jaxb2SourceCallback callback = new Jaxb2SourceCallback(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled object, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final Object unmarshalFromRequestPayload(MessageContext messageContext, Class<?> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { Jaxb2SourceCallback callback = new Jaxb2SourceCallback(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled object, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final Object unmarshalFromRequestPayload(MessageContext messageContext, Class<?> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { Jaxb2SourceCallback callback = new Jaxb2SourceCallback(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context as {@link JAXBElement}. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled element, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final <T> JAXBElement<T> unmarshalElementFromRequestPayload(MessageContext messageContext, Class<T> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { JaxbElementSourceCallback<T> callback = new JaxbElementSourceCallback<T>(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context as {@link JAXBElement}. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled element, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final <T> JAXBElement<T> unmarshalElementFromRequestPayload(MessageContext messageContext, Class<T> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { JaxbElementSourceCallback<T> callback = new JaxbElementSourceCallback<T>(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }
/** * Unmarshals the request payload of the given message context as {@link JAXBElement}. * * @param messageContext the message context to unmarshal from * @param clazz the class to unmarshal * @return the unmarshalled element, or {@code null} if the request has no payload * @throws JAXBException in case of JAXB2 errors */ protected final <T> JAXBElement<T> unmarshalElementFromRequestPayload(MessageContext messageContext, Class<T> clazz) throws JAXBException { Source requestPayload = getRequestPayload(messageContext); if (requestPayload == null) { return null; } try { JaxbElementSourceCallback<T> callback = new JaxbElementSourceCallback<T>(clazz); TraxUtils.doWithSource(requestPayload, callback); if (logger.isDebugEnabled()) { logger.debug("Unmarshalled payload request to [" + callback.result + "]"); } return callback.result; } catch (Exception ex) { throw convertToJaxbException(ex); } }