Class AbstractPayloadSourceMethodProcessor
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor
- All Implemented Interfaces:
MethodArgumentResolver
,MethodReturnValueHandler
- Direct Known Subclasses:
Dom4jPayloadMethodProcessor
,DomPayloadMethodProcessor
,JDomPayloadMethodProcessor
,SourcePayloadMethodProcessor
,XomPayloadMethodProcessor
Abstract base class for
MethodArgumentResolver
and MethodReturnValueHandler
implementations based on
Source
s.- 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 abstract Source
createResponsePayload
(org.springframework.core.MethodParameter returnType, Object returnValue) Creates a response payload for the given return value.final void
handleReturnValue
(MessageContext messageContext, org.springframework.core.MethodParameter returnType, Object returnValue) Handles the given return value.final Object
resolveArgument
(MessageContext messageContext, org.springframework.core.MethodParameter parameter) Resolves the given parameter into a method argument.protected abstract Object
resolveRequestPayloadArgument
(org.springframework.core.MethodParameter parameter, Source requestPayload) Resolves the given parameter, annotated withRequestPayload
, 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
-
Constructor Details
-
AbstractPayloadSourceMethodProcessor
public AbstractPayloadSourceMethodProcessor()
-
-
Method Details
-
resolveArgument
public final Object resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) throws Exception Description copied from interface:MethodArgumentResolver
Resolves the given parameter into a method argument.- Parameters:
messageContext
- the current message contextparameter
- the parameter to resolve to an argument. This parameter must have previously been passed to theMethodArgumentResolver.supportsParameter(MethodParameter)
method of this interface, which must have returnedtrue
.- Returns:
- the resolved argument. May be
null
. - Throws:
Exception
- in case of errors
-
resolveRequestPayloadArgument
protected abstract Object resolveRequestPayloadArgument(org.springframework.core.MethodParameter parameter, Source requestPayload) throws Exception Resolves the given parameter, annotated withRequestPayload
, into a method argument.- Parameters:
parameter
- the parameter to resolve to an argumentrequestPayload
- the request payload- Returns:
- the resolved argument. May be
null
. - Throws:
Exception
- in case of errors
-
handleReturnValue
public final void handleReturnValue(MessageContext messageContext, org.springframework.core.MethodParameter returnType, Object returnValue) throws Exception Description copied from interface:MethodReturnValueHandler
Handles the given return value.- Parameters:
messageContext
- the current message contextreturnType
- the return type to handle. This type must have previously been passed to theMethodReturnValueHandler.supportsReturnType(MethodParameter)
method of this interface, which must have returnedtrue
.returnValue
- the return value to handle- Throws:
Exception
- in case of errors
-
createResponsePayload
protected abstract Source createResponsePayload(org.springframework.core.MethodParameter returnType, Object returnValue) throws Exception Creates a response payload for the given return value.- Parameters:
returnType
- the return type to handlereturnValue
- the return value to handle- Returns:
- the response payload
- Throws:
Exception
- in case of errors
-