MCPcopy Create free account
hub / github.com/google/guice / makeInjectable

Method makeInjectable

core/src/com/google/inject/internal/Scoping.java:309–322  ·  view source on GitHub ↗

Replaces annotation scopes with instance scopes using the Injector's annotation-to-instance map. If the scope annotation has no corresponding instance, an error will be added and unscoped will be returned.

(Scoping scoping, InjectorImpl injector, Errors errors)

Source from the content-addressed store, hash-verified

307 * will be returned.
308 */
309 static Scoping makeInjectable(Scoping scoping, InjectorImpl injector, Errors errors) {
310 Class<? extends Annotation> scopeAnnotation = scoping.getScopeAnnotation();
311 if (scopeAnnotation == null) {
312 return scoping;
313 }
314
315 ScopeBinding scope = injector.getBindingData().getScopeBinding(scopeAnnotation);
316 if (scope != null) {
317 return forInstance(scope.getScope());
318 }
319
320 errors.scopeNotFound(scopeAnnotation);
321 return UNSCOPED;
322 }
323}

Callers 3

prepareBindingMethod · 0.95
createMethod · 0.95

Calls 6

forInstanceMethod · 0.95
getScopeMethod · 0.95
getScopeAnnotationMethod · 0.80
getBindingDataMethod · 0.80
scopeNotFoundMethod · 0.80
getScopeBindingMethod · 0.45

Tested by

no test coverage detected