Class XomPayloadMethodProcessor
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor
org.springframework.ws.server.endpoint.adapter.method.dom.XomPayloadMethodProcessor
- All Implemented Interfaces:
MethodArgumentResolver
,MethodReturnValueHandler
Implementation of
MethodArgumentResolver
and MethodReturnValueHandler
that supports XOM elements.- 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 DocumentBuilderFactory
Create aDocumentBuilderFactory
that this resolver will use to create response payloads.protected Source
createResponsePayload
(org.springframework.core.MethodParameter returnType, Object returnValue) Creates a response payload for the given return value.protected nu.xom.Element
resolveRequestPayloadArgument
(org.springframework.core.MethodParameter parameter, Source requestPayload) Resolves the given parameter, annotated withRequestPayload
, into a method argument.protected boolean
supportsRequestPayloadParameter
(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter, annotated withRequestPayload
, is supported by this resolver.protected boolean
supportsResponsePayloadReturnType
(org.springframework.core.MethodParameter returnType) Indicates whether the given method return type, annotated withResponsePayload
, is supported.Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor
handleReturnValue, resolveArgument
Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
convertToByteArrayInputStream, supportsParameter, supportsReturnType
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Constructor Details
-
XomPayloadMethodProcessor
public XomPayloadMethodProcessor()
-
-
Method Details
-
supportsRequestPayloadParameter
protected boolean supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter) Description copied from class:AbstractPayloadMethodProcessor
Indicates whether the given method parameter, annotated withRequestPayload
, is supported by this resolver.- Specified by:
supportsRequestPayloadParameter
in classAbstractPayloadMethodProcessor
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveRequestPayloadArgument
protected nu.xom.Element resolveRequestPayloadArgument(org.springframework.core.MethodParameter parameter, Source requestPayload) throws TransformerException, IOException, nu.xom.ParsingException Description copied from class:AbstractPayloadSourceMethodProcessor
Resolves the given parameter, annotated withRequestPayload
, into a method argument.- Specified by:
resolveRequestPayloadArgument
in classAbstractPayloadSourceMethodProcessor
- Parameters:
parameter
- the parameter to resolve to an argumentrequestPayload
- the request payload- Returns:
- the resolved argument. May be
null
. - Throws:
TransformerException
IOException
nu.xom.ParsingException
-
supportsResponsePayloadReturnType
protected boolean supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType) Description copied from class:AbstractPayloadMethodProcessor
Indicates whether the given method return type, annotated withResponsePayload
, is supported.- Specified by:
supportsResponsePayloadReturnType
in classAbstractPayloadMethodProcessor
- Parameters:
returnType
- the method parameter to check- Returns:
true
if this resolver supports the supplied return type;false
otherwise
-
createResponsePayload
protected Source createResponsePayload(org.springframework.core.MethodParameter returnType, Object returnValue) throws ParserConfigurationException Description copied from class:AbstractPayloadSourceMethodProcessor
Creates a response payload for the given return value.- Specified by:
createResponsePayload
in classAbstractPayloadSourceMethodProcessor
- Parameters:
returnType
- the return type to handlereturnValue
- the return value to handle- Returns:
- the response payload
- Throws:
ParserConfigurationException
-
createDocumentBuilderFactory
Create aDocumentBuilderFactory
that this resolver will use to create response payloads.Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so this method will only be called once.
- Returns:
- the created factory
-