@Override public void validate() throws CoreException { final JaxrsResource resource = getElement(); JaxrsMetamodelValidator.deleteJaxrsMarkers(resource); Logger.debug("Validating element {}", getElement()); for (IJaxrsResourceMethod resourceMethod : resource.getAllMethods()) { new JaxrsResourceMethodValidatorDelegate( getMarkerManager(), (JaxrsResourceMethod) resourceMethod) .validate(); } }
// FIXME deal with interfaces/implementations public final void addFrom(final IJavaElement scope, final SubProgressMonitor progressMonitor) throws CoreException { progressMonitor.beginTask("Adding resources and resourceMethods", 1); HTTPMethods httpMethods = metamodel.getHttpMethods(); List<IType> javaTypes = JAXRSAnnotationsScanner.findResources(scope, httpMethods.getTypeNames(), progressMonitor); for (IType javaType : javaTypes) { try { resources.put( javaType.getFullyQualifiedName(), new Resource(javaType, metamodel, progressMonitor)); } catch (InvalidModelElementException e) { Logger.warn( "Type '" + javaType.getFullyQualifiedName() + "' is not a valid JAX-RS Resource: " + e.getMessage()); } } }