private Unmarshaller createUnmarshaller(Class<?> clazz) throws JAXBException { return createUnmarshaller(getJaxbContext(clazz)); }
private Marshaller createMarshaller(Class<?> clazz) throws JAXBException { return createMarshaller(getJaxbContext(clazz)); }
@Override public final void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws Exception { if (returnValue != null) { handleReturnValueInternal(messageContext, returnType, returnValue); } }
/** * 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); } }
private Marshaller createMarshaller(Class<?> clazz) throws JAXBException { JAXBContext jaxbContext = getJaxbContext(clazz); return jaxbContext.createMarshaller(); }
/** * 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); } }
private Unmarshaller createUnmarshaller(Class<?> clazz) throws JAXBException { JAXBContext jaxbContext = getJaxbContext(clazz); return jaxbContext.createUnmarshaller(); }
/** * 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); } }
private Unmarshaller createUnmarshaller(Class<?> clazz) throws JAXBException { return createUnmarshaller(getJaxbContext(clazz)); }
private Marshaller createMarshaller(Class<?> clazz) throws JAXBException { return createMarshaller(getJaxbContext(clazz)); }
@Override public final void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws Exception { if (returnValue != null) { handleReturnValueInternal(messageContext, returnType, returnValue); } }
/** * 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); } }
private Unmarshaller createUnmarshaller(Class<?> clazz) throws JAXBException { return createUnmarshaller(getJaxbContext(clazz)); }
private Marshaller createMarshaller(Class<?> clazz) throws JAXBException { return createMarshaller(getJaxbContext(clazz)); }
@Override public final void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws Exception { if (returnValue != null) { handleReturnValueInternal(messageContext, returnType, returnValue); } }
/** * 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); } }