Class XPathParamMethodArgumentResolver

java.lang.Object
org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
All Implemented Interfaces:
MethodArgumentResolver

public class XPathParamMethodArgumentResolver extends Object implements 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 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

      public void setTransformerHelper(TransformerHelper transformerHelper)
    • 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 interface MethodArgumentResolver
      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, XPathExpressionException
      Description copied from interface: MethodArgumentResolver
      Resolves the given parameter into a method argument.
      Specified by:
      resolveArgument in interface MethodArgumentResolver
      Parameters:
      messageContext - the current message context
      parameter - 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.
      Returns:
      the resolved argument. May be null.
      Throws:
      TransformerException
      XPathExpressionException
    • createXPathFactory

      protected XPathFactory createXPathFactory()
      Create a XPathFactory that this resolver will use to create XPath 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