Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter.method
Class AbstractPayloadSourceMethodProcessor

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.AbstractPayloadSourceMethodProcessor
All Implemented Interfaces:
MethodArgumentResolver, MethodReturnValueHandler
Direct Known Subclasses:
Dom4jPayloadMethodProcessor, DomPayloadMethodProcessor, JDomPayloadMethodProcessor, SourcePayloadMethodProcessor, XomPayloadMethodProcessor

public abstract class AbstractPayloadSourceMethodProcessor
extends AbstractPayloadMethodProcessor

Abstract base class for MethodArgumentResolver and MethodReturnValueHandler implementations based on Sources.

Since:
2.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
AbstractPayloadSourceMethodProcessor()
           
 
Method Summary
protected abstract  Source createResponsePayload(MethodParameter returnType, Object returnValue)
          Creates a response payload for the given return value.
 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 abstract  Object resolveRequestPayloadArgument(MethodParameter parameter, Source requestPayload)
          Resolves the given parameter, annotated with RequestPayload, into a method argument.
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
convertToByteArrayInputStream, supportsParameter, supportsRequestPayloadParameter, supportsResponsePayloadReturnType, 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

AbstractPayloadSourceMethodProcessor

public AbstractPayloadSourceMethodProcessor()
Method Detail

resolveArgument

public final Object resolveArgument(MessageContext messageContext,
                                    MethodParameter parameter)
                             throws Exception
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:
Exception - in case of errors

resolveRequestPayloadArgument

protected abstract Object resolveRequestPayloadArgument(MethodParameter parameter,
                                                        Source requestPayload)
                                                 throws Exception
Resolves the given parameter, annotated with RequestPayload, into a method argument.

Parameters:
parameter - the parameter to resolve to an argument
requestPayload - the request payload
Returns:
the resolved argument. May be null.
Throws:
Exception - in case of errors

handleReturnValue

public final void handleReturnValue(MessageContext messageContext,
                                    MethodParameter returnType,
                                    Object returnValue)
                             throws Exception
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:
Exception - in case of errors

createResponsePayload

protected abstract Source createResponsePayload(MethodParameter returnType,
                                                Object returnValue)
                                         throws Exception
Creates a response payload for the given return value.

Parameters:
returnType - the return type to handle
returnValue - the return value to handle
Returns:
the response payload
Throws:
Exception - in case of errors

Spring Web Services Framework

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