StaxPayloadMethodArgumentResolver extends TransformerObjectSupport implements MethodArgumentResolver { @Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws TransformerException, XMLStreamException { Source source = messageContext.getRequest().getPayloadSource(); if (source == null) { return null; } Class<?> parameterType = parameter.getParameterType(); if (XMLStreamReader.class.equals(parameterType)) { return resolveStreamReader(source); } else if (XMLEventReader.class.equals(parameterType)) { return resolveEventReader(source); } throw new UnsupportedOperationException(); }  @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MessageContext messageContext, MethodParameter parameter);  }
@Test public void resolveStreamReaderSaaj() throws Exception { MessageContext messageContext = createSaajMessageContext(); Object result = resolver.resolveArgument(messageContext, streamParameter); testStreamReader(result); }
@Test public void resolveStreamReaderAxiomCaching() throws Exception { MessageContext messageContext = createCachingAxiomMessageContext(); Object result = resolver.resolveArgument(messageContext, streamParameter); testStreamReader(result); }
@Test public void resolveStreamReaderAxiomNonCaching() throws Exception { MessageContext messageContext = createNonCachingAxiomMessageContext(); Object result = resolver.resolveArgument(messageContext, streamParameter); testStreamReader(result); }
@Test public void resolveStreamReaderStream() throws Exception { MessageContext messageContext = createMockMessageContext(); Object result = resolver.resolveArgument(messageContext, streamParameter); testStreamReader(result); }
@Test public void resolveEventReaderSaaj() throws Exception { MessageContext messageContext = createSaajMessageContext(); Object result = resolver.resolveArgument(messageContext, eventParameter); testEventReader(result); }
@Test public void resolveEventReaderAxiomCaching() throws Exception { MessageContext messageContext = createCachingAxiomMessageContext(); Object result = resolver.resolveArgument(messageContext, eventParameter); testEventReader(result); }
@Test public void resolveEventReaderAxiomNonCaching() throws Exception { MessageContext messageContext = createNonCachingAxiomMessageContext(); Object result = resolver.resolveArgument(messageContext, eventParameter); testEventReader(result); }
@Test public void resolveEventReaderStream() throws Exception { MessageContext messageContext = createMockMessageContext(); Object result = resolver.resolveArgument(messageContext, eventParameter); testEventReader(result); }