Spring Web Services Framework

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

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
All Implemented Interfaces:
MethodArgumentResolver, MethodReturnValueHandler
Direct Known Subclasses:
AbstractJaxb2PayloadMethodProcessor, AbstractPayloadSourceMethodProcessor, MarshallingPayloadMethodProcessor

public abstract class AbstractPayloadMethodProcessor
extends TransformerObjectSupport
implements MethodArgumentResolver, MethodReturnValueHandler

Abstract base class for MethodArgumentResolver and MethodReturnValueHandler implementations based on RequestPayload and ResponsePayload annotations.

Since:
2.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
AbstractPayloadMethodProcessor()
           
 
Method Summary
protected  ByteArrayInputStream convertToByteArrayInputStream(Source source)
          Converts the given source to a byte array input stream.
 boolean supportsParameter(MethodParameter parameter)
          Indicates whether the given method parameter is supported by this resolver.
protected abstract  boolean supportsRequestPayloadParameter(MethodParameter parameter)
          Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.
protected abstract  boolean supportsResponsePayloadReturnType(MethodParameter returnType)
          Indicates whether the given method return type, annotated with ResponsePayload, is supported.
 boolean supportsReturnType(MethodParameter returnType)
          Indicates whether the given method return type is supported by this handler.
 
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
 
Methods inherited from interface org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
resolveArgument
 
Methods inherited from interface org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
handleReturnValue
 

Constructor Detail

AbstractPayloadMethodProcessor

public AbstractPayloadMethodProcessor()
Method Detail

supportsParameter

public final boolean supportsParameter(MethodParameter parameter)
Indicates whether the given method parameter is supported by this resolver.

This implementation gets checks if the given parameter is annotated with RequestPayload, and invokes supportsRequestPayloadParameter(org.springframework.core.MethodParameter) afterwards.

Specified by:
supportsParameter in interface MethodArgumentResolver
Parameters:
parameter - the method parameter to check
Returns:
true if this resolver supports the supplied parameter; false otherwise

supportsRequestPayloadParameter

protected abstract boolean supportsRequestPayloadParameter(MethodParameter parameter)
Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.

Parameters:
parameter - the method parameter to check
Returns:
true if this resolver supports the supplied parameter; false otherwise

supportsReturnType

public final boolean supportsReturnType(MethodParameter returnType)
Indicates whether the given method return type is supported by this handler.

This implementation gets checks if the method of the given return type is annotated with ResponsePayload, and invokes supportsResponsePayloadReturnType(org.springframework.core.MethodParameter) afterwards.

Specified by:
supportsReturnType in interface MethodReturnValueHandler
Parameters:
returnType - the method return type to check
Returns:
true if this handler supports the supplied return type; false otherwise

supportsResponsePayloadReturnType

protected abstract boolean supportsResponsePayloadReturnType(MethodParameter returnType)
Indicates whether the given method return type, annotated with ResponsePayload, is supported.

Parameters:
returnType - the method parameter to check
Returns:
true if this resolver supports the supplied return type; false otherwise

convertToByteArrayInputStream

protected ByteArrayInputStream convertToByteArrayInputStream(Source source)
                                                      throws TransformerException
Converts the given source to a byte array input stream.

Parameters:
source - the source to convert
Returns:
the input stream
Throws:
TransformerException - in case of transformation errors

Spring Web Services Framework

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