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 CreationalContext<?>find(java.lang.Object key)Find an existingCreationalContextby key in the current active scope, or returnnullif no context was found in the given scope with the given key.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.voidput(java.lang.Object key, CreationalContext<?> creationalContext)Adds aCreationalContextto this scope resolver under the given key.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
-
find
public CreationalContext<?> find(java.lang.Object key) throws ScopeNotActiveException
Description copied from interface:ScopeResolverFind an existingCreationalContextby key in the current active scope, or returnnullif no context was found in the given scope with the given key.- Specified by:
findin interfaceScopeResolver- Parameters:
key- an object suitable as a key for use in a map, cannot benull- Returns:
- a
CreationalContextif found, otherwisenull - Throws:
ScopeNotActiveException- when there is no scope active
-
put
public void put(java.lang.Object key, CreationalContext<?> creationalContext) throws ScopeNotActiveExceptionDescription copied from interface:ScopeResolverAdds aCreationalContextto this scope resolver under the given key.- Specified by:
putin interfaceScopeResolver- Parameters:
key- an object suitable as a key for use in a map, cannot benullcreationalContext- aCreationalContext, cannot benull- Throws:
ScopeNotActiveException- when there is no scope active
-
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
-
-