public class XomPayloadMethodProcessor extends AbstractPayloadSourceMethodProcessor
MethodArgumentResolver
and MethodReturnValueHandler
that supports XOM elements.logger
Constructor and Description |
---|
XomPayloadMethodProcessor() |
Modifier and Type | Method and Description |
---|---|
protected DocumentBuilderFactory |
createDocumentBuilderFactory()
Create a
DocumentBuilderFactory 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 with
RequestPayload , into a method argument. |
protected boolean |
supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter)
Indicates whether the given method parameter, annotated with
RequestPayload ,
is supported by this resolver. |
protected boolean |
supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType)
Indicates whether the given method return type, annotated with
ResponsePayload , is supported. |
handleReturnValue, resolveArgument
convertToByteArrayInputStream, supportsParameter, supportsReturnType
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
protected boolean supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter)
AbstractPayloadMethodProcessor
RequestPayload
,
is supported by this resolver.supportsRequestPayloadParameter
in class AbstractPayloadMethodProcessor
parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter; false
otherwiseprotected nu.xom.Element resolveRequestPayloadArgument(org.springframework.core.MethodParameter parameter, Source requestPayload) throws TransformerException, IOException, nu.xom.ParsingException
AbstractPayloadSourceMethodProcessor
RequestPayload
, into a method argument.resolveRequestPayloadArgument
in class AbstractPayloadSourceMethodProcessor
parameter
- the parameter to resolve to an argumentrequestPayload
- the request payloadnull
.TransformerException
IOException
nu.xom.ParsingException
protected boolean supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType)
AbstractPayloadMethodProcessor
ResponsePayload
, is supported.supportsResponsePayloadReturnType
in class AbstractPayloadMethodProcessor
returnType
- the method parameter to checktrue
if this resolver supports the supplied return type; false
otherwiseprotected Source createResponsePayload(org.springframework.core.MethodParameter returnType, Object returnValue) throws ParserConfigurationException
AbstractPayloadSourceMethodProcessor
createResponsePayload
in class AbstractPayloadSourceMethodProcessor
returnType
- the return type to handlereturnValue
- the return value to handleParserConfigurationException
protected DocumentBuilderFactory createDocumentBuilderFactory()
DocumentBuilderFactory
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.
Copyright © 2018 Pivotal Software. All rights reserved.