void configure(Binder binder) { binder = binder.withSource(method); SecondaryBinder<?, ?> sbinder = ThrowingProviderBinder.create(binder).bind(checkedProvider, key.getTypeLiteral()); if (key.getAnnotation() != null) { sbinder = sbinder.annotatedWith(key.getAnnotation()); } else if (key.getAnnotationType() != null) { sbinder = sbinder.annotatedWith(key.getAnnotationType()); } sbinder.scopeExceptions(scopeExceptions); ScopedBindingBuilder sbbuilder = sbinder.toProviderMethod(this); if (scopeAnnotation != null) { sbbuilder.in(scopeAnnotation); } if (exposed) { // the cast is safe 'cause the only binder we have implements PrivateBinder. If there's a // misplaced @Exposed, calling this will add an error to the binder's error queue ((PrivateBinder) binder).expose(sbinder.getKey()); } CheckedProvideUtils.validateExceptions( binder, exceptionTypes, sbinder.getExceptionTypes(), checkedProvider); }
void configure(Binder binder) { binder = binder.withSource(method); SecondaryBinder<?, ?> sbinder = ThrowingProviderBinder.create(binder) .bind(checkedProvider, key.getTypeLiteral()); if(key.getAnnotation() != null) { sbinder = sbinder.annotatedWith(key.getAnnotation()); } else if(key.getAnnotationType() != null) { sbinder = sbinder.annotatedWith(key.getAnnotationType()); } ScopedBindingBuilder sbbuilder = sbinder.toProviderMethod(this); if(scopeAnnotation != null) { sbbuilder.in(scopeAnnotation); } if (exposed) { // the cast is safe 'cause the only binder we have implements PrivateBinder. If there's a // misplaced @Exposed, calling this will add an error to the binder's error queue ((PrivateBinder) binder).expose(sbinder.getKey()); } CheckedProvideUtils.validateExceptions( binder, exceptionTypes, sbinder.getExceptionTypes(), checkedProvider); }