XPathParamMethodArgumentResolver implements MethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { if (parameter.getParameterAnnotation(XPathParam.class) == null) { return false; } Class<?> parameterType = parameter.getParameterType(); if (Boolean.class.equals(parameterType) || Boolean.TYPE.equals(parameterType) || Double.class.equals(parameterType) || Double.TYPE.equals(parameterType) || Node.class.isAssignableFrom(parameterType) || NodeList.class.isAssignableFrom(parameterType) || String.class.isAssignableFrom(parameterType)) { return true; } else { return conversionService.canConvert(String.class, parameterType); } }  void setConversionService(ConversionService conversionService); void setTransformerHelper(TransformerHelper transformerHelper); @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MessageContext messageContext, MethodParameter parameter);  }
@Test public void supportsParameter() { assertTrue("resolver does not support boolean parameter", resolver.supportsParameter(booleanParameter)); assertTrue("resolver does not support double parameter", resolver.supportsParameter(doubleParameter)); assertTrue("resolver does not support Node parameter", resolver.supportsParameter(nodeParameter)); assertTrue("resolver does not support NodeList parameter", resolver.supportsParameter(nodeListParameter)); assertTrue("resolver does not support String parameter", resolver.supportsParameter(stringParameter)); assertTrue("resolver does not support String parameter", resolver.supportsParameter(convertedParameter)); assertFalse("resolver supports parameter without @XPathParam", resolver.supportsParameter(unsupportedParameter)); }