@Singleton public class DynamicSingletonProvider extends DynamicClassProvider
DynamicClassProvider, which applies singleton scope
to generated classes.
The main intention is to reduce code size from common case from
@ScopeAnnotation(Singleton.class) @ProvidedBy(DynamicClassProvider.class)
to simply @ProvidedBy(DynamicSingletonProvider.class).
If used with injectors hierarchy or within private modules, use together with
GeneratorAnchorModule to properly scope dynamic bindings.
for more docs| Constructor and Description |
|---|
DynamicSingletonProvider(com.google.inject.Injector injector) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Class<? extends java.lang.annotation.Annotation> |
getScopeAnnotation()
Override it to specify different annotation.
|
get@Inject public DynamicSingletonProvider(com.google.inject.Injector injector)
protected java.lang.Class<? extends java.lang.annotation.Annotation> getScopeAnnotation()
DynamicClassProvidergetScopeAnnotation in class DynamicClassProvider