Package org.int4.dirk.core.definition
Class ExtendedScopeResolver
- java.lang.Object
-
- org.int4.dirk.core.definition.ExtendedScopeResolver
-
- All Implemented Interfaces:
ScopeResolver
public class ExtendedScopeResolver extends java.lang.Object implements ScopeResolver
Wrapper forScopeResolverwith additional information useful for the internal workings of the injector framework.
-
-
Constructor Summary
Constructors Constructor Description ExtendedScopeResolver(ScopeResolver delegate, boolean isPseudoScope, boolean isDependentScope)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(java.lang.Object key, CreationalContext<T> creationalContext)Returns an existing instance associated with the given key, or uses the given context to create one.java.lang.annotation.AnnotationgetAnnotation()Returns the annotation this resolver handles.booleanisActive()Returnstruewhen this scope is currently active, otherwisefalse.booleanisDependentScope()Returns whether thisScopeResolverrepresents the dependent pseudo-scope.booleanisPseudoScope()Returns whether thisScopeResolverrepresents a pseudo-scope.voidremove(java.lang.Object key)Removes the given key from this scope resolver.
-
-
-
Constructor Detail
-
ExtendedScopeResolver
public ExtendedScopeResolver(ScopeResolver delegate, boolean isPseudoScope, boolean isDependentScope)
Constructs a new instance.- Parameters:
delegate- a delegateScopeResolver, cannot benullisPseudoScope- whether the delegate represents a pseudo-scopeisDependentScope- whether the delegate represents the dependent scope
-
-
Method Detail
-
isPseudoScope
public boolean isPseudoScope()
Returns whether thisScopeResolverrepresents a pseudo-scope.- Returns:
trueif it represents a pseudo-scope, otherwisefalse
-
isDependentScope
public boolean isDependentScope()
Returns whether thisScopeResolverrepresents the dependent pseudo-scope.- Returns:
trueif it represents the dependent pseudo-scope, otherwisefalse
-
getAnnotation
public java.lang.annotation.Annotation getAnnotation()
Description copied from interface:ScopeResolverReturns the annotation this resolver handles. Returnsnullwhen the handler handles unscoped injectables.- Specified by:
getAnnotationin interfaceScopeResolver- Returns:
- the annotation this resolver handles, never
null
-
isActive
public boolean isActive()
Description copied from interface:ScopeResolverReturnstruewhen this scope is currently active, otherwisefalse.- Specified by:
isActivein interfaceScopeResolver- Returns:
truewhen this scope is currently active, otherwisefalse
-
get
public <T> T get(java.lang.Object key, CreationalContext<T> creationalContext) throws ScopeNotActiveException, java.lang.ExceptionDescription copied from interface:ScopeResolverReturns an existing instance associated with the given key, or uses the given context to create one.- Specified by:
getin interfaceScopeResolver- Type Parameters:
T- the type of the instances provided by theCreationalContext- Parameters:
key- an object suitable as a key for use in a map, cannot benullcreationalContext- anCreationalContext, cannot benull- Returns:
- an instance of the given type, never
null - Throws:
ScopeNotActiveException- when there is no scope activejava.lang.Exception- when the object factory throws an exception
-
remove
public void remove(java.lang.Object key)
Description copied from interface:ScopeResolverRemoves the given key from this scope resolver.- Specified by:
removein interfaceScopeResolver- Parameters:
key- an object suitable as a key for use in a map, cannot benull
-
-