@Override protected void handleReturnValueInternal(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws JAXBException { Class<?> parameterType = returnType.getParameterType(); marshalToResponsePayload(messageContext, parameterType, returnValue); }
public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { Class<?> parameterType = parameter.getParameterType(); if (parameterType.isAnnotationPresent(XmlRootElement.class)) { return unmarshalFromRequestPayload(messageContext, parameterType); } else { JAXBElement<?> element = unmarshalElementFromRequestPayload(messageContext, parameterType); return element != null ? element.getValue() : null; } }
private void initMethodReturnValueHandlers() { if (CollectionUtils.isEmpty(methodReturnValueHandlers)) { List<MethodReturnValueHandler> methodReturnValueHandlers = new ArrayList<MethodReturnValueHandler>(); methodReturnValueHandlers.add(new DomPayloadMethodProcessor()); methodReturnValueHandlers.add(new SourcePayloadMethodProcessor()); if (isPresent(DOM4J_CLASS_NAME)) { methodReturnValueHandlers.add(new Dom4jPayloadMethodProcessor()); } if (isPresent(JAXB2_CLASS_NAME)) { methodReturnValueHandlers.add(new XmlRootElementPayloadMethodProcessor()); methodReturnValueHandlers.add(new JaxbElementPayloadMethodProcessor()); } if (isPresent(JDOM_CLASS_NAME)) { methodReturnValueHandlers.add(new JDomPayloadMethodProcessor()); } if (isPresent(XOM_CLASS_NAME)) { methodArgumentResolvers.add(new XomPayloadMethodProcessor()); } if (logger.isDebugEnabled()) { logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers); } setMethodReturnValueHandlers(methodReturnValueHandlers); } }
private void initMethodReturnValueHandlers() { if (CollectionUtils.isEmpty(methodReturnValueHandlers)) { List<MethodReturnValueHandler> methodReturnValueHandlers = new ArrayList<MethodReturnValueHandler>(); methodReturnValueHandlers.add(new DomPayloadMethodProcessor()); methodReturnValueHandlers.add(new SourcePayloadMethodProcessor()); if (isPresent(DOM4J_CLASS_NAME)) { methodReturnValueHandlers.add(new Dom4jPayloadMethodProcessor()); } if (isPresent(JAXB2_CLASS_NAME)) { methodReturnValueHandlers.add(new XmlRootElementPayloadMethodProcessor()); methodReturnValueHandlers.add(new JaxbElementPayloadMethodProcessor()); } if (isPresent(JDOM_CLASS_NAME)) { methodReturnValueHandlers.add(new JDomPayloadMethodProcessor()); } if (isPresent(XOM_CLASS_NAME)) { methodReturnValueHandlers.add(new XomPayloadMethodProcessor()); } if (logger.isDebugEnabled()) { logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers); } if (getCustomMethodReturnValueHandlers() != null) { methodReturnValueHandlers.addAll(getCustomMethodReturnValueHandlers()); } setMethodReturnValueHandlers(methodReturnValueHandlers); } }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { Class<?> parameterType = parameter.getParameterType(); if (parameterType.isAnnotationPresent(XmlRootElement.class)) { return unmarshalFromRequestPayload(messageContext, parameterType); } else { JAXBElement<?> element = unmarshalElementFromRequestPayload(messageContext, parameterType); return element != null ? element.getValue() : null; } }
private void initMethodReturnValueHandlers() { if (CollectionUtils.isEmpty(methodReturnValueHandlers)) { List<MethodReturnValueHandler> methodReturnValueHandlers = new ArrayList<MethodReturnValueHandler>(); methodReturnValueHandlers.add(new DomPayloadMethodProcessor()); methodReturnValueHandlers.add(new SourcePayloadMethodProcessor()); if (isPresent(DOM4J_CLASS_NAME)) { methodReturnValueHandlers.add(new Dom4jPayloadMethodProcessor()); } if (isPresent(JAXB2_CLASS_NAME)) { methodReturnValueHandlers.add(new XmlRootElementPayloadMethodProcessor()); methodReturnValueHandlers.add(new JaxbElementPayloadMethodProcessor()); } if (isPresent(JDOM_CLASS_NAME)) { methodReturnValueHandlers.add(new JDomPayloadMethodProcessor()); } if (isPresent(XOM_CLASS_NAME)) { methodReturnValueHandlers.add(new XomPayloadMethodProcessor()); } if (logger.isDebugEnabled()) { logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers); } if (getCustomMethodReturnValueHandlers() != null) { methodReturnValueHandlers.addAll(getCustomMethodReturnValueHandlers()); } setMethodReturnValueHandlers(methodReturnValueHandlers); } }
@Override protected void handleReturnValueInternal(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws JAXBException { Class<?> parameterType = returnType.getParameterType(); marshalToResponsePayload(messageContext, parameterType, returnValue); }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { Class<?> parameterType = parameter.getParameterType(); if (parameterType.isAnnotationPresent(XmlRootElement.class)) { return unmarshalFromRequestPayload(messageContext, parameterType); } else { JAXBElement<?> element = unmarshalElementFromRequestPayload(messageContext, parameterType); return element != null ? element.getValue() : null; } }
private void initMethodReturnValueHandlers() { if (CollectionUtils.isEmpty(methodReturnValueHandlers)) { List<MethodReturnValueHandler> methodReturnValueHandlers = new ArrayList<MethodReturnValueHandler>(); methodReturnValueHandlers.add(new DomPayloadMethodProcessor()); methodReturnValueHandlers.add(new SourcePayloadMethodProcessor()); if (isPresent(DOM4J_CLASS_NAME)) { methodReturnValueHandlers.add(new Dom4jPayloadMethodProcessor()); } if (isPresent(JAXB2_CLASS_NAME)) { methodReturnValueHandlers.add(new XmlRootElementPayloadMethodProcessor()); methodReturnValueHandlers.add(new JaxbElementPayloadMethodProcessor()); } if (isPresent(JDOM_CLASS_NAME)) { methodReturnValueHandlers.add(new JDomPayloadMethodProcessor()); } if (isPresent(XOM_CLASS_NAME)) { methodReturnValueHandlers.add(new XomPayloadMethodProcessor()); } if (logger.isDebugEnabled()) { logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers); } if (getCustomMethodReturnValueHandlers() != null) { methodReturnValueHandlers.addAll(getCustomMethodReturnValueHandlers()); } setMethodReturnValueHandlers(methodReturnValueHandlers); } }
public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws JAXBException { Class<?> parameterType = returnType.getParameterType(); marshalToResponsePayload(messageContext, parameterType, returnValue); }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { Class<?> parameterType = parameter.getParameterType(); if (parameterType.isAnnotationPresent(XmlRootElement.class)) { return unmarshalFromRequestPayload(messageContext, parameterType); } else { JAXBElement<?> element = unmarshalElementFromRequestPayload(messageContext, parameterType); return element != null ? element.getValue() : null; } }
methodArgumentResolvers.add(new XmlRootElementPayloadMethodProcessor()); methodArgumentResolvers.add(new JaxbElementPayloadMethodProcessor());
@Override protected void handleReturnValueInternal(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws JAXBException { Class<?> parameterType = returnType.getParameterType(); marshalToResponsePayload(messageContext, parameterType, returnValue); }
methodArgumentResolvers.add(new XmlRootElementPayloadMethodProcessor()); methodArgumentResolvers.add(new JaxbElementPayloadMethodProcessor());
methodArgumentResolvers.add(new XmlRootElementPayloadMethodProcessor()); methodArgumentResolvers.add(new JaxbElementPayloadMethodProcessor());
methodArgumentResolvers.add(new XmlRootElementPayloadMethodProcessor()); methodArgumentResolvers.add(new JaxbElementPayloadMethodProcessor());