/** * Invoked when the list of allowed methods needs to be updated. The {@link #getAllowedMethods()} or the * {@link #setAllowedMethods(Set)} methods should be used. The default implementation lists the annotated * methods. */ public void updateAllowedMethods() { getAllowedMethods().clear(); List<AnnotationInfo> annotations = getAnnotations(); if (annotations != null) { for (AnnotationInfo annotationInfo : annotations) { if (annotationInfo instanceof MethodAnnotationInfo) { MethodAnnotationInfo methodAnnotationInfo = (MethodAnnotationInfo) annotationInfo; if (!getAllowedMethods().contains( methodAnnotationInfo.getRestletMethod())) { getAllowedMethods().add( methodAnnotationInfo.getRestletMethod()); } } } } }
methodsList.addAll(((ServerResource) resource).getAllowedMethods());