Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter.method.jaxb
Class XmlRootElementPayloadMethodProcessor

java.lang.Object
  

extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
          extended by org.springframework.ws.server.endpoint.adapter.method.jaxb.AbstractJaxb2PayloadMethodProcessor
              extended by org.springframework.ws.server.endpoint.adapter.method.jaxb.XmlRootElementPayloadMethodProcessor
All Implemented Interfaces:
MethodArgumentResolver, MethodReturnValueHandler

public class XmlRootElementPayloadMethodProcessor
extends AbstractJaxb2PayloadMethodProcessor

Implementation of MethodArgumentResolver and MethodReturnValueHandler that supports parameters annotated with @XmlRootElement or @XmlType, and return values annotated with @XmlRootElement.

Since:
2.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
XmlRootElementPayloadMethodProcessor()
           
 
Method Summary
 void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
          Handles the given return value.
 Object resolveArgument(MessageContext messageContext, MethodParameter parameter)
          Resolves the given parameter into a method argument.
protected  boolean supportsRequestPayloadParameter(MethodParameter parameter)
          Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.
protected  boolean supportsResponsePayloadReturnType(MethodParameter returnType)
          Indicates whether the given method return type, annotated with ResponsePayload, is supported.
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.jaxb.AbstractJaxb2PayloadMethodProcessor
createMarshaller, createUnmarshaller, marshalToResponsePayload, unmarshalElementFromRequestPayload, unmarshalFromRequestPayload
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
convertToByteArrayInputStream, supportsParameter, supportsReturnType
 
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRootElementPayloadMethodProcessor

public XmlRootElementPayloadMethodProcessor()
Method Detail

supportsRequestPayloadParameter

protected boolean supportsRequestPayloadParameter(MethodParameter parameter)
Description copied from class: AbstractPayloadMethodProcessor
Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.

Specified by:
supportsRequestPayloadParameter in class AbstractPayloadMethodProcessor
Parameters:
parameter - the method parameter to check
Returns:
true if this resolver supports the supplied parameter; false otherwise

resolveArgument

public Object resolveArgument(MessageContext messageContext,
                              MethodParameter parameter)
                       throws JAXBException
Description copied from interface: MethodArgumentResolver
Resolves the given parameter into a method argument.

Parameters:
messageContext - the current message context
parameter - the parameter to resolve to an argument. This parameter must have previously been passed to the MethodArgumentResolver.supportsParameter(MethodParameter) method of this interface, which must have returned true.
Returns:
the resolved argument. May be null.
Throws:
JAXBException

supportsResponsePayloadReturnType

protected boolean supportsResponsePayloadReturnType(MethodParameter returnType)
Description copied from class: AbstractPayloadMethodProcessor
Indicates whether the given method return type, annotated with ResponsePayload, is supported.

Specified by:
supportsResponsePayloadReturnType in class AbstractPayloadMethodProcessor
Parameters:
returnType - the method parameter to check
Returns:
true if this resolver supports the supplied return type; false otherwise

handleReturnValue

public void handleReturnValue(MessageContext messageContext,
                              MethodParameter returnType,
                              Object returnValue)
                       throws JAXBException
Description copied from interface: MethodReturnValueHandler
Handles the given return value.

Parameters:
messageContext - the current message context
returnType - the return type to handle. This type must have previously been passed to the MethodReturnValueHandler.supportsReturnType(MethodParameter) method of this interface, which must have returned true.
returnValue - the return value to handle
Throws:
JAXBException

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.