XmlRootElementEndpointMapping extends AbstractAnnotationMethodEndpointMapping<QName> { @Override protected QName getLookupKeyForMethod(Method method) { Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { MethodParameter methodParameter = new MethodParameter(method, i); Class<?> parameterType = methodParameter.getParameterType(); if (parameterType.isAnnotationPresent(XmlRootElement.class)) { QName result = handleRootElement(parameterType); if (result != null) { return result; } } } return null; }  void setTransformerHelper(TransformerHelper transformerHelper);  }
@Test public void rootElement() throws NoSuchMethodException { Method rootElement = getClass().getMethod("rootElement", MyRootElement.class); QName name = mapping.getLookupKeyForMethod(rootElement); assertEquals(new QName("myNamespace", "myRoot"), name); }