@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetFactory.get(errors.withSource(targetKey), context, dependency); }
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return delegate.getInternalFactory().get(errors, context, dependency); } }
@Override public T call(InternalContext context) throws ErrorsException { Dependency dependency = context.getDependency(); return internalFactory.get(errors, context, dependency); } });
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetBinding.getInternalFactory().get( errors.withSource(targetKey), context, dependency); } };
private T inject(Errors errors, InternalContext context) throws ErrorsException { context.setDependency(dependency); try { return factory.get(errors.withSource(dependency), context, dependency); } finally { context.setDependency(null); } }
@Override public void inject(Errors errors, InternalContext context, Object o) { errors = errors.withSource(dependency); context.setDependency(dependency); try { Object value = factory.get(errors, context, dependency); field.set(o, value); } catch (ErrorsException e) { errors.withSource(injectionPoint).merge(e.getErrors()); } catch (IllegalAccessException e) { throw new AssertionError(e); // a security manager is blocking us, we're hosed } finally { context.setDependency(null); } } }
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { errors = errors.withSource(providerKey); Provider<? extends T> provider = providerFactory.get(errors, context, dependency); try { return errors.checkForNull(provider.get(), source, dependency); } catch (RuntimeException userException) { throw errors.errorInProvider(userException).toException(); } }
@Override public T get(Errors errors, InternalContext context, Dependency dependency) throws ErrorsException { errors = errors.withSource(providerKey); Provider<?> provider = providerBinding.getInternalFactory().get( errors, context, dependency); try { Object o = provider.get(); if (o != null && !rawType.isInstance(o)) { throw errors.subtypeNotProvided(providerType, rawType).toException(); } @SuppressWarnings("unchecked") // protected by isInstance() check above T t = (T) o; return t; } catch (RuntimeException e) { throw errors.errorInProvider(e).toException(); } } };
@Override public Void call(InternalContext context) { context.setDependency(dependency); Errors errorsForBinding = errors.withSource(dependency); try { binding.getInternalFactory().get(errorsForBinding, context, dependency); } catch (ErrorsException e) { errorsForBinding.merge(e.getErrors()); } finally { context.setDependency(null); } return null; } });
@Override public T call(InternalContext context) throws ErrorsException { Dependency dependency = context.getDependency(); return internalFactory.get(errors, context, dependency); } });
@Override public T call(InternalContext context) throws ErrorsException { Dependency dependency = context.getDependency(); return internalFactory.get(errors, context, dependency); } });
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return delegate.getInternalFactory().get(errors, context, dependency); } }
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetFactory.get(errors.withSource(targetKey), context, dependency); }
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetBinding.getInternalFactory().get( errors.withSource(targetKey), context, dependency); } };
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetBinding.getInternalFactory().get( errors.withSource(targetKey), context, dependency); } };
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { return targetBinding.getInternalFactory().get( errors.withSource(targetKey), context, dependency); } };
private T inject(Errors errors, InternalContext context) throws ErrorsException { context.setDependency(dependency); try { return factory.get(errors.withSource(dependency), context, dependency); } finally { context.setDependency(null); } }
private T inject(Errors errors, InternalContext context) throws ErrorsException { context.setDependency(dependency); try { return factory.get(errors.withSource(dependency), context, dependency); } finally { context.setDependency(null); } }
private T inject(Errors errors, InternalContext context) throws ErrorsException { context.setDependency(dependency); try { return factory.get(errors.withSource(dependency), context, dependency); } finally { context.setDependency(null); } }
@Override public T get(Errors errors, InternalContext context, Dependency<?> dependency) throws ErrorsException { errors = errors.withSource(providerKey); Provider<? extends T> provider = providerFactory.get(errors, context, dependency); try { return errors.checkForNull(provider.get(), source, dependency); } catch (RuntimeException userException) { throw errors.errorInProvider(userException).toException(); } }