StaxPayloadMethodArgumentResolver extends TransformerObjectSupport implements MethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { if (parameter.getParameterAnnotation(RequestPayload.class) == null) { return false; } else { Class<?> parameterType = parameter.getParameterType(); return XMLStreamReader.class.equals(parameterType) || XMLEventReader.class.equals(parameterType); } }  @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MessageContext messageContext, MethodParameter parameter);  }
@Test public void supportsParameter() { assertTrue("resolver does not support XMLStreamReader", resolver.supportsParameter(streamParameter)); assertTrue("resolver does not support XMLEventReader", resolver.supportsParameter(eventParameter)); assertFalse("resolver supports invalid parameter", resolver.supportsParameter(invalidParameter)); }