public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport implements MethodArgumentResolver
MethodArgumentResolver
that supports StAX XMLStreamReader
and XMLEventReader
arguments.logger
Constructor and Description |
---|
StaxPayloadMethodArgumentResolver() |
Modifier and Type | Method and Description |
---|---|
protected XMLInputFactory |
createXmlInputFactory()
Create a
XMLInputFactory that this resolver will use to create XMLStreamReader and XMLEventReader objects. |
Object |
resolveArgument(MessageContext messageContext,
org.springframework.core.MethodParameter parameter)
Resolves the given parameter into a method argument.
|
boolean |
supportsParameter(org.springframework.core.MethodParameter parameter)
Indicates whether the given method parameter is supported by this resolver.
|
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
MethodArgumentResolver
supportsParameter
in interface MethodArgumentResolver
parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter; false
otherwisepublic Object resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) throws TransformerException, XMLStreamException
MethodArgumentResolver
resolveArgument
in interface MethodArgumentResolver
messageContext
- the current message contextparameter
- the parameter to resolve to an argument. This parameter must have previously been passed to
the MethodArgumentResolver.supportsParameter(MethodParameter)
method of this interface, which must
have returned true
.null
.TransformerException
XMLStreamException
protected XMLInputFactory createXmlInputFactory()
XMLInputFactory
that this resolver will use to create XMLStreamReader
and XMLEventReader
objects.
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 © 2020 Pivotal Software. All rights reserved.