/** * The Logger is a special case because it knows the injection point of the injected member. It's * the only binding that does this. */ private static void bindLogger(InjectorImpl injector) { Key<Logger> key = Key.get(Logger.class); LoggerFactory loggerFactory = new LoggerFactory(); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, loggerFactory, emptySet())); }
/** * The Injector is a special case because we allow both parent and child injectors to both have * a binding for that key. */ private static void bindInjector(InjectorImpl injector) { Key<Injector> key = Key.get(Injector.class); InjectorFactory injectorFactory = new InjectorFactory(injector); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, injectorFactory, Scoping.UNSCOPED, injectorFactory, emptySet())); }
private void putBinding(BindingImpl<?> binding) { Key<?> key = binding.getKey(); Class<?> rawType = key.getRawType(); if (FORBIDDEN_TYPES.contains(rawType)) { errors.cannotBindToGuiceType(rawType.getSimpleName()); return; } Binding<?> original = injector.state.getExplicitBinding(key); if (original != null && !isOkayDuplicate(original, binding)) { errors.bindingAlreadySet(key, original.getSource()); return; } // prevent the parent from creating a JIT binding for this key injector.state.parent().blacklist(key); injector.state.putBinding(key, binding); }
/** * The Injector is a special case because we allow both parent and child injectors to both have * a binding for that key. */ private static void bindInjector(InjectorImpl injector) { Key<Injector> key = Key.get(Injector.class); InjectorFactory injectorFactory = new InjectorFactory(injector); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, injectorFactory, Scoping.UNSCOPED, injectorFactory, emptySet())); }
/** * The Injector is a special case because we allow both parent and child injectors to both have * a binding for that key. */ private static void bindInjector(InjectorImpl injector) { Key<Injector> key = Key.get(Injector.class); InjectorFactory injectorFactory = new InjectorFactory(injector); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, injectorFactory, Scoping.UNSCOPED, injectorFactory, emptySet())); }
/** * The Logger is a special case because it knows the injection point of the injected member. It's * the only binding that does this. */ private static void bindLogger(InjectorImpl injector) { Key<Logger> key = Key.get(Logger.class); LoggerFactory loggerFactory = new LoggerFactory(); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, loggerFactory, emptySet())); }
/** * The Logger is a special case because it knows the injection point of the injected member. It's * the only binding that does this. */ private static void bindLogger(InjectorImpl injector) { Key<Logger> key = Key.get(Logger.class); LoggerFactory loggerFactory = new LoggerFactory(); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, loggerFactory, emptySet())); }
/** * The Injector is a special case because we allow both parent and child injectors to both have * a binding for that key. */ private static void bindInjector(InjectorImpl injector) { Key<Injector> key = Key.get(Injector.class); InjectorFactory injectorFactory = new InjectorFactory(injector); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, injectorFactory, Scoping.UNSCOPED, injectorFactory, emptySet())); }
/** * The Logger is a special case because it knows the injection point of the injected member. It's * the only binding that does this. */ private static void bindLogger(InjectorImpl injector) { Key<Logger> key = Key.get(Logger.class); LoggerFactory loggerFactory = new LoggerFactory(); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, loggerFactory, emptySet())); }
/** * The Injector is a special case because we allow both parent and child injectors to both have * a binding for that key. */ private static void bindInjector(InjectorImpl injector) { Key<Injector> key = Key.get(Injector.class); InjectorFactory injectorFactory = new InjectorFactory(injector); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, injectorFactory, Scoping.UNSCOPED, injectorFactory, ImmutableSet.<InjectionPoint>of())); }
/** * The Logger is a special case because it knows the injection point of the injected member. It's * the only binding that does this. */ private static void bindLogger(InjectorImpl injector) { Key<Logger> key = Key.get(Logger.class); LoggerFactory loggerFactory = new LoggerFactory(); injector.state.putBinding(key, new ProviderInstanceBindingImpl<>(injector, key, SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, loggerFactory, ImmutableSet.<InjectionPoint>of())); }
private void putBinding(BindingImpl<?> binding) { Key<?> key = binding.getKey(); Class<?> rawType = key.getRawType(); if (FORBIDDEN_TYPES.contains(rawType)) { errors.cannotBindToGuiceType(rawType.getSimpleName()); return; } Binding<?> original = injector.state.getExplicitBinding(key); if (original != null && !isOkayDuplicate(original, binding)) { errors.bindingAlreadySet(key, original.getSource()); return; } // prevent the parent from creating a JIT binding for this key injector.state.parent().blacklist(key); injector.state.putBinding(key, binding); }
private void putBinding(BindingImpl<?> binding) { Key<?> key = binding.getKey(); Class<?> rawType = key.getRawType(); if (FORBIDDEN_TYPES.contains(rawType)) { errors.cannotBindToGuiceType(rawType.getSimpleName()); return; } Binding<?> original = injector.state.getExplicitBinding(key); if (original != null && !isOkayDuplicate(original, binding)) { errors.bindingAlreadySet(key, original.getSource()); return; } // prevent the parent from creating a JIT binding for this key injector.state.parent().blacklist(key); injector.state.putBinding(key, binding); }
private void putBinding(BindingImpl<?> binding) { Key<?> key = binding.getKey(); Class<?> rawType = key.getRawType(); if (FORBIDDEN_TYPES.contains(rawType)) { errors.cannotBindToGuiceType(rawType.getSimpleName()); return; } Binding<?> original = injector.state.getExplicitBinding(key); if (original != null && !isOkayDuplicate(original, binding)) { errors.bindingAlreadySet(key, original.getSource()); return; } // prevent the parent from creating a JIT binding for this key injector.state.parent().blacklist(key); injector.state.putBinding(key, binding); }
private void putBinding(BindingImpl<?> binding) { Key<?> key = binding.getKey(); Class<?> rawType = key.getRawType(); if (FORBIDDEN_TYPES.contains(rawType)) { errors.cannotBindToGuiceType(rawType.getSimpleName()); return; } Binding<?> original = injector.state.getExplicitBinding(key); if (original != null && !isOkayDuplicate(original, binding)) { errors.bindingAlreadySet(key, original.getSource()); return; } // prevent the parent from creating a JIT binding for this key injector.state.parent().blacklist(key); injector.state.putBinding(key, binding); }