false);
}
});
}
for (Class<?> providerClass : classes) {
final ContractProvider model = componentBag.getModel(providerClass);
ProviderBinder.bindProvider(providerClass, model, dynamicConfiguration);
}
// Bind pure provider instances except for pure meta-providers and providers with empty contract models (e.g. resources)
Set<Object> instances = componentBag.getInstances(filter);
if (constrainedTo != null) {
instances = Sets.filter(instances, new Predicate<Object>() {
@Override
public boolean apply(Object component) {
final Class<?> componentClass = component.getClass();
return Providers.checkProviderRuntime(
componentClass,
componentBag.getModel(componentClass),
constrainedTo,
registeredClasses == null || !registeredClasses.contains(componentClass),
false);
}
});
}
for (Object provider : instances) {
final ContractProvider model = componentBag.getModel(provider.getClass());
ProviderBinder.bindProvider(provider, model, dynamicConfiguration);
}
}