Class XPathParamMethodArgumentResolver
java.lang.Object
org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
- All Implemented Interfaces:
MethodArgumentResolver
Implementation of
MethodArgumentResolver that supports the @XPathParam annotation.
This resolver supports parameters annotated with @XPathParam that specifies the XPath expression
that should be bound to that parameter. The parameter can either a "natively supported" XPath type (boolean, double, String, Node, or NodeList), or a type that is
supported by the ConversionService.
- Since:
- 2.0
- Author:
- Arjen Poutsma
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected XPathFactoryCreate aXPathFactorythat this resolver will use to createXPathobjects.resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) Resolves the given parameter into a method argument.voidsetConversionService(org.springframework.core.convert.ConversionService conversionService) Sets the conversion service to use.voidsetTransformerHelper(TransformerHelper transformerHelper) booleansupportsParameter(org.springframework.core.MethodParameter parameter) Indicates whether the given method parameter is supported by this resolver.
-
Constructor Details
-
XPathParamMethodArgumentResolver
public XPathParamMethodArgumentResolver()
-
-
Method Details
-
setConversionService
public void setConversionService(org.springframework.core.convert.ConversionService conversionService) Sets the conversion service to use.Defaults to the default conversion service.
-
setTransformerHelper
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Description copied from interface:MethodArgumentResolverIndicates whether the given method parameter is supported by this resolver.- Specified by:
supportsParameterin interfaceMethodArgumentResolver- Parameters:
parameter- the method parameter to check- Returns:
trueif this resolver supports the supplied parameter;falseotherwise
-
resolveArgument
public Object resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) throws TransformerException, XPathExpressionException Description copied from interface:MethodArgumentResolverResolves the given parameter into a method argument.- Specified by:
resolveArgumentin 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:
TransformerExceptionXPathExpressionException
-
createXPathFactory
Create aXPathFactorythat this resolver will use to createXPathobjects.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
-