@Override public Method createMethod(AbstractResource r, AbstractResourceMethod m) { Method method = delegate.createMethod(r, m); Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<>(); for (Annotation a : r.getResourceClass().getAnnotations()) { Class<? extends Annotation> type = a.annotationType(); if (type.getAnnotation(WadlAnnotation.class) != null) { annotations.put(type, a); } } for (Annotation a : m.getMethod().getAnnotations()) { Class<? extends Annotation> type = a.annotationType(); if (type.getAnnotation(WadlAnnotation.class) != null) { annotations.put(type, a); } } for (Annotation a : annotations.values()) { WadlAnnotation wadlAnnotation = checkNotNull(a.annotationType().getAnnotation(WadlAnnotation.class)); Map<QName, String> attr = method.getOtherAttributes(); String value = annotationStringValue(a); for (String xmlElement : wadlAnnotation.value()) { attr.put(new QName(NESSAPI_XML_NS, xmlElement, NESSAPI_XML_PREFIX), value); } } return method; }