/** * Invoked by Guice at Injector-creation time to prepare providers for each * element in this set. At this time the set's size is known, but its * contents are only evaluated when get() is invoked. */ @Inject public void initialize(Injector injector) { providers = new ArrayList<>(); Set<Dependency<?>> dependencies = new HashSet<>(); for (Binding<?> entry : injector.findBindingsByType(elementType)) { if (keyMatches(entry.getKey())) { @SuppressWarnings("unchecked") // protected by findBindingsByType() Binding<T> binding = (Binding<T>) entry; providers.add(binding.getProvider()); dependencies.add(Dependency.get(binding.getKey())); } } this.dependencies = unmodifiableSet(dependencies); this.binder = null; }
@Override public <T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type) { return this.delegateInjector.findBindingsByType(type); }
/** * Invoked by Guice at Injector-creation time to prepare providers for each * element in this set. At this time the set's size is known, but its * contents are only evaluated when get() is invoked. */ @Inject public void initialize(Injector injector) { providers = new ArrayList<>(); Set<Dependency<?>> dependencies = new HashSet<>(); for (Binding<?> entry : injector.findBindingsByType(elementType)) { if (keyMatches(entry.getKey())) { @SuppressWarnings("unchecked") // protected by findBindingsByType() Binding<T> binding = (Binding<T>) entry; providers.add(binding.getProvider()); dependencies.add(Dependency.get(binding.getKey())); } } this.dependencies = unmodifiableSet(dependencies); this.binder = null; }
/** * Invoked by Guice at Injector-creation time to prepare providers for each * element in this set. At this time the set's size is known, but its * contents are only evaluated when get() is invoked. */ @Inject public void initialize(Injector injector) { providers = new ArrayList<>(); Set<Dependency<?>> dependencies = new HashSet<>(); for (Binding<?> entry : injector.findBindingsByType(elementType)) { if (keyMatches(entry.getKey())) { @SuppressWarnings("unchecked") // protected by findBindingsByType() Binding<T> binding = (Binding<T>) entry; providers.add(binding.getProvider()); dependencies.add(Dependency.get(binding.getKey())); } } this.dependencies = unmodifiableSet(dependencies); this.binder = null; }
/** * Invoked by Guice at Injector-creation time to prepare providers for each * element in this set. At this time the set's size is known, but its * contents are only evaluated when get() is invoked. */ @Inject public void initialize(Injector injector) { providers = new ArrayList<>(); Set<Dependency<?>> dependencies = new HashSet<>(); for (Binding<?> entry : injector.findBindingsByType(elementType)) { if (keyMatches(entry.getKey())) { @SuppressWarnings("unchecked") // protected by findBindingsByType() Binding<T> binding = (Binding<T>) entry; providers.add(binding.getProvider()); dependencies.add(Dependency.get(binding.getKey())); } } this.dependencies = unmodifiableSet(dependencies); this.binder = null; }
/** * Invoked by Guice at Injector-creation time to prepare providers for each * element in this set. At this time the set's size is known, but its * contents are only evaluated when get() is invoked. */ @Inject public void initialize(Injector injector) { providers = new ArrayList<>(); List<Dependency<?>> dependencies = new ArrayList<>(); for (Binding<?> entry : injector.findBindingsByType(elementType)) { if (keyMatches(entry.getKey())) { @SuppressWarnings("unchecked") // protected by findBindingsByType() Binding<T> binding = (Binding<T>) entry; providers.add(binding.getProvider()); dependencies.add(Dependency.get(binding.getKey())); } } this.dependencies = ImmutableSet.copyOf(dependencies); this.binder = null; }