Search in sources :

Example 1 with ServiceProviders

use of org.openide.util.lookup.ServiceProviders in project netbeans-rcp-lite by outersky.

the class ServiceProviderProcessor method handleProcess.

protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    for (Element el : roundEnv.getElementsAnnotatedWith(ServiceProvider.class)) {
        ServiceProvider sp = el.getAnnotation(ServiceProvider.class);
        if (sp == null) {
            continue;
        }
        register(el, ServiceProvider.class, sp);
    }
    for (Element el : roundEnv.getElementsAnnotatedWith(ServiceProviders.class)) {
        ServiceProviders spp = el.getAnnotation(ServiceProviders.class);
        if (spp == null) {
            continue;
        }
        for (ServiceProvider sp : spp.value()) {
            register(el, ServiceProviders.class, sp);
        }
    }
    return true;
}
Also used : ServiceProviders(org.openide.util.lookup.ServiceProviders) ExecutableElement(javax.lang.model.element.ExecutableElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) ServiceProvider(org.openide.util.lookup.ServiceProvider)

Aggregations

Element (javax.lang.model.element.Element)1 ExecutableElement (javax.lang.model.element.ExecutableElement)1 TypeElement (javax.lang.model.element.TypeElement)1 ServiceProvider (org.openide.util.lookup.ServiceProvider)1 ServiceProviders (org.openide.util.lookup.ServiceProviders)1