Class AbstractPayloadMethodProcessor
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected ByteArrayInputStream
convertToByteArrayInputStream
(Source source) Converts the given source to a byte array input stream.final boolean
supportsParameter
(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter is supported by this resolver.protected abstract boolean
supportsRequestPayloadParameter
(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter, annotated withRequestPayload
, is supported by this resolver.protected abstract boolean
supportsResponsePayloadReturnType
(org.springframework.core.MethodParameter returnType) Indicates whether the given method return type, annotated withResponsePayload
, is supported.final boolean
supportsReturnType
(org.springframework.core.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 Details
-
AbstractPayloadMethodProcessor
public AbstractPayloadMethodProcessor()
-
-
Method Details
-
supportsParameter
public final boolean supportsParameter(org.springframework.core.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 invokessupportsRequestPayloadParameter(org.springframework.core.MethodParameter)
afterwards.- Specified by:
supportsParameter
in interfaceMethodArgumentResolver
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
supportsRequestPayloadParameter
protected abstract boolean supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter, annotated withRequestPayload
, 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(org.springframework.core.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 invokessupportsResponsePayloadReturnType(org.springframework.core.MethodParameter)
afterwards.- Specified by:
supportsReturnType
in interfaceMethodReturnValueHandler
- 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(org.springframework.core.MethodParameter returnType) Indicates whether the given method return type, annotated withResponsePayload
, 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
-