@Override @SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
/** * Gets a binding implementation. First, it check to see if the parent has a binding. If the * parent has a binding and the binding is scoped, it will use that binding. Otherwise, this * checks for an explicit binding. If no explicit binding is found, it looks for a just-in-time * binding. */ <T> BindingImpl<T> getBindingOrThrow(Key<T> key, Errors errors, JitLimitation jitType) throws ErrorsException { // Check explicit bindings, i.e. bindings created by modules. BindingImpl<T> binding = state.getExplicitBinding(key); if (binding != null) { return binding; } // Look for an on-demand binding. return getJustInTimeBinding(key, errors, jitType); }
@Override public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
bindingFailed = true; } else if (state.getExplicitBinding(depKey) == null) {
if (original != null) { if (injector.state.getExplicitBinding(key) != null) { try { if (!isOkayDuplicate(original, binding, injector.state)) {
@Override public <T> BindingImpl<T> getExistingBinding(Key<T> key) { BindingImpl<T> explicitBinding = state.getExplicitBinding(key); if (explicitBinding != null) { return explicitBinding;
BindingImpl<String> stringBinding = state.getExplicitBinding(stringKey); if (stringBinding == null || !stringBinding.isConstant()) { return null;
@Override @SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
@Override @SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
@SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
@SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
@SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
@SuppressWarnings("unchecked") // we only put in BindingImpls that match their key types public <T> BindingImpl<T> getExplicitBinding(Key<T> key) { Binding<?> binding = explicitBindings.get(key); return binding != null ? (BindingImpl<T>) binding : parent.getExplicitBinding(key); }
/** * Gets a binding implementation. First, it check to see if the parent has a binding. If the * parent has a binding and the binding is scoped, it will use that binding. Otherwise, this * checks for an explicit binding. If no explicit binding is found, it looks for a just-in-time * binding. */ <T> BindingImpl<T> getBindingOrThrow(Key<T> key, Errors errors, JitLimitation jitType) throws ErrorsException { // Check explicit bindings, i.e. bindings created by modules. BindingImpl<T> binding = state.getExplicitBinding(key); if (binding != null) { return binding; } // Look for an on-demand binding. return getJustInTimeBinding(key, errors, jitType); }
public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
@Override public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }
@Override public void notify(Errors errors) { InjectorImpl privateInjector = (InjectorImpl) privateElements.getInjector(); BindingImpl<T> explicitBinding = privateInjector.state.getExplicitBinding(key); // validate that the child injector has its own factory. If the getInternalFactory() returns // this, then that child injector doesn't have a factory (and getExplicitBinding has returned // its parent's binding instead if (explicitBinding.getInternalFactory() == this) { errors.withSource(explicitBinding.getSource()).exposedButNotBound(key); return; } this.delegate = explicitBinding; }