java.lang.Object
org.elasticsearch.injection.guice.internal.Scoping
References a scope, either directly (as a scope instance), or indirectly (as a scope annotation).
The scope's eager or laziness is also exposed.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the scope instance, ornull
if that isn't known for this instance.boolean
Returns true if this scope is a singleton that should be loaded eagerly instage
.boolean
Returns true if this scope was explicitly applied.boolean
Returns true if this is the default scope.
-
Field Details
-
UNSCOPED
No scoping annotation has been applied. Note that this is different fromin(Scopes.NO_SCOPE)
, where the 'NO_SCOPE' has been explicitly applied. -
EAGER_SINGLETON
-
-
Method Details
-
isExplicitlyScoped
public boolean isExplicitlyScoped()Returns true if this scope was explicitly applied. If no scope was explicitly applied then the scoping annotation will be used. -
isNoScope
public boolean isNoScope()Returns true if this is the default scope. In this case a new instance will be provided for each injection. -
isEagerSingleton
public boolean isEagerSingleton()Returns true if this scope is a singleton that should be loaded eagerly instage
. -
getScopeInstance
Returns the scope instance, ornull
if that isn't known for this instance.
-