Class StaxPayloadMethodArgumentResolver
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.adapter.method.StaxPayloadMethodArgumentResolver
- All Implemented Interfaces:
MethodArgumentResolver
public class StaxPayloadMethodArgumentResolver
extends TransformerObjectSupport
implements MethodArgumentResolver
Implementation of
MethodArgumentResolver
that supports StAX XMLStreamReader
and
XMLEventReader
arguments.- 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 XMLInputFactory
Create aXMLInputFactory
that this resolver will use to createXMLStreamReader
andXMLEventReader
objects.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.Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Constructor Details
-
StaxPayloadMethodArgumentResolver
public StaxPayloadMethodArgumentResolver()
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Description copied from interface:MethodArgumentResolver
Indicates whether the given method parameter is supported by this resolver.- Specified by:
supportsParameter
in interfaceMethodArgumentResolver
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveArgument
public Object resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) throws TransformerException, XMLStreamException Description copied from interface:MethodArgumentResolver
Resolves the given parameter into a method argument.- Specified by:
resolveArgument
in interfaceMethodArgumentResolver
- 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:
TransformerException
XMLStreamException
-
createXmlInputFactory
Create aXMLInputFactory
that this resolver will use to createXMLStreamReader
andXMLEventReader
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.
- Returns:
- the created factory
-