Search in sources :

Example 1 with OSGiService

use of org.apache.sling.models.annotations.injectorspecific.OSGiService in project sling by apache.

the class OSGiServiceInjector method getValue.

public Object getValue(@Nonnull Object adaptable, String name, @Nonnull Type type, @Nonnull AnnotatedElement element, @Nonnull DisposalCallbackRegistry callbackRegistry) {
    OSGiService annotation = element.getAnnotation(OSGiService.class);
    String filterString = null;
    if (annotation != null) {
        if (StringUtils.isNotBlank(annotation.filter())) {
            filterString = annotation.filter();
        }
    } else {
        Filter filter = element.getAnnotation(Filter.class);
        if (filter != null) {
            filterString = filter.value();
        }
    }
    return getValue(adaptable, type, filterString, callbackRegistry);
}
Also used : Filter(org.apache.sling.models.annotations.Filter) OSGiService(org.apache.sling.models.annotations.injectorspecific.OSGiService)

Aggregations

Filter (org.apache.sling.models.annotations.Filter)1 OSGiService (org.apache.sling.models.annotations.injectorspecific.OSGiService)1