Package com.google.inject.spi
Class DefaultBindingScopingVisitor<V>
- java.lang.Object
-
- com.google.inject.spi.DefaultBindingScopingVisitor<V>
-
- Type Parameters:
V- any type to be returned by the visit method. UseVoidwithreturn nullif no return type is needed.
- All Implemented Interfaces:
BindingScopingVisitor<V>
public class DefaultBindingScopingVisitor<V> extends Object implements BindingScopingVisitor<V>
No-op visitor for subclassing. All interface methods simply delegate tovisitOther(), returning its result.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description DefaultBindingScopingVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VvisitEagerSingleton()Visit an eager singleton or single instance.VvisitNoScoping()Visit an unspecified or unscoped strategy.protected VvisitOther()Default visit implementation.VvisitScope(Scope scope)Visit a scope instance.VvisitScopeAnnotation(Class<? extends Annotation> scopeAnnotation)Visit a scope annotation.
-
-
-
Method Detail
-
visitOther
protected V visitOther()
Default visit implementation. Returnsnull.
-
visitEagerSingleton
public V visitEagerSingleton()
Description copied from interface:BindingScopingVisitorVisit an eager singleton or single instance. This scope strategy is found on both module and injector bindings.- Specified by:
visitEagerSingletonin interfaceBindingScopingVisitor<V>
-
visitScope
public V visitScope(Scope scope)
Description copied from interface:BindingScopingVisitorVisit a scope instance. This scope strategy is found on both module and injector bindings.- Specified by:
visitScopein interfaceBindingScopingVisitor<V>
-
visitScopeAnnotation
public V visitScopeAnnotation(Class<? extends Annotation> scopeAnnotation)
Description copied from interface:BindingScopingVisitorVisit a scope annotation. This scope strategy is found only on module bindings. The instance that implements this scope is registered byBinder.bindScope().- Specified by:
visitScopeAnnotationin interfaceBindingScopingVisitor<V>
-
visitNoScoping
public V visitNoScoping()
Description copied from interface:BindingScopingVisitorVisit an unspecified or unscoped strategy. On a module, this strategy indicates that the injector should use scoping annotations to find a scope. On an injector, it indicates that no scope is applied to the binding. An unscoped binding will behave like a scoped one when it is linked to a scoped binding.- Specified by:
visitNoScopingin interfaceBindingScopingVisitor<V>
-
-