use of org.eclipse.e4.core.di.extensions.Service in project eclipse.platform.runtime by eclipse.
the class ServiceSupplier method get.
@Override
public Object get(IObjectDescriptor descriptor, IRequestor requestor, boolean track, boolean group) {
Type desiredType = descriptor.getDesiredType();
Bundle b = FrameworkUtil.getBundle(requestor.getRequestingObjectClass());
Service qualifier = descriptor.getQualifier(Service.class);
if (desiredType instanceof ParameterizedType) {
ParameterizedType t = (ParameterizedType) desiredType;
if (t.getRawType() == Collections.class || t.getRawType() == List.class) {
return handleCollection(b, t.getActualTypeArguments()[0], requestor, track && qualifier.dynamic(), qualifier);
}
}
return handleSingle(b, desiredType, requestor, descriptor, track && qualifier.dynamic(), qualifier);
}
Aggregations