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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DocumentBuilderFactoryCreate aDocumentBuilderFactorythat this resolver will use to create response payloads.protected SourcecreateResponsePayload(org.springframework.core.MethodParameter returnType, Object returnValue) Creates a response payload for the given return value.protected nu.xom.ElementresolveRequestPayloadArgument(org.springframework.core.MethodParameter parameter, Source requestPayload) Resolves the given parameter, annotated withRequestPayload, into a method argument.protected booleansupportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter, annotated withRequestPayload, is supported by this resolver.protected booleansupportsResponsePayloadReturnType(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, resolveArgumentMethods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
convertToByteArrayInputStream, supportsParameter, supportsReturnTypeMethods 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:AbstractPayloadMethodProcessorIndicates whether the given method parameter, annotated withRequestPayload, is supported by this resolver.- Specified by:
supportsRequestPayloadParameterin classAbstractPayloadMethodProcessor- Parameters:
parameter- the method parameter to check- Returns:
trueif this resolver supports the supplied parameter;falseotherwise
-
resolveRequestPayloadArgument
protected nu.xom.Element resolveRequestPayloadArgument(org.springframework.core.MethodParameter parameter, Source requestPayload) throws TransformerException, IOException, nu.xom.ParsingException Description copied from class:AbstractPayloadSourceMethodProcessorResolves the given parameter, annotated withRequestPayload, into a method argument.- Specified by:
resolveRequestPayloadArgumentin classAbstractPayloadSourceMethodProcessor- Parameters:
parameter- the parameter to resolve to an argumentrequestPayload- the request payload- Returns:
- the resolved argument. May be
null. - Throws:
TransformerExceptionIOExceptionnu.xom.ParsingException
-
supportsResponsePayloadReturnType
protected boolean supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType) Description copied from class:AbstractPayloadMethodProcessorIndicates whether the given method return type, annotated withResponsePayload, is supported.- Specified by:
supportsResponsePayloadReturnTypein classAbstractPayloadMethodProcessor- Parameters:
returnType- the method parameter to check- Returns:
trueif this resolver supports the supplied return type;falseotherwise
-
createResponsePayload
protected Source createResponsePayload(org.springframework.core.MethodParameter returnType, Object returnValue) throws ParserConfigurationException Description copied from class:AbstractPayloadSourceMethodProcessorCreates a response payload for the given return value.- Specified by:
createResponsePayloadin classAbstractPayloadSourceMethodProcessor- Parameters:
returnType- the return type to handlereturnValue- the return value to handle- Returns:
- the response payload
- Throws:
ParserConfigurationException
-
createDocumentBuilderFactory
Create aDocumentBuilderFactorythat 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
-