public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSupport implements MethodArgumentResolver, MethodReturnValueHandler
MethodArgumentResolver
and MethodReturnValueHandler
implementations based on
RequestPayload
and ResponsePayload
annotations.logger
Constructor and Description |
---|
AbstractPayloadMethodProcessor() |
Modifier and Type | Method and Description |
---|---|
protected ByteArrayInputStream |
convertToByteArrayInputStream(Source source)
Converts the given source to a byte array input stream.
|
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 with
RequestPayload ,
is supported by this resolver. |
protected abstract boolean |
supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType)
Indicates whether the given method return type, annotated with
ResponsePayload , is supported. |
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType)
Indicates whether the given method return type is supported by this handler.
|
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolveArgument
handleReturnValue
public final boolean supportsParameter(org.springframework.core.MethodParameter parameter)
This implementation gets checks if the given parameter is annotated with RequestPayload
, and invokes
supportsRequestPayloadParameter(org.springframework.core.MethodParameter)
afterwards.
supportsParameter
in interface MethodArgumentResolver
parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter; false
otherwiseprotected abstract boolean supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter)
RequestPayload
,
is supported by this resolver.parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter; false
otherwisepublic final boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
This implementation gets checks if the method of the given return type is annotated with ResponsePayload
,
and invokes supportsResponsePayloadReturnType(org.springframework.core.MethodParameter)
afterwards.
supportsReturnType
in interface MethodReturnValueHandler
returnType
- the method return type to checktrue
if this handler supports the supplied return type; false
otherwiseprotected abstract boolean supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType)
ResponsePayload
, is supported.returnType
- the method parameter to checktrue
if this resolver supports the supplied return type; false
otherwiseprotected ByteArrayInputStream convertToByteArrayInputStream(Source source) throws TransformerException
source
- the source to convertTransformerException
- in case of transformation errorsCopyright © 2020 Pivotal Software. All rights reserved.