Package org.int4.dirk.core.definition
Interface Instantiator<T>
-
- Type Parameters:
T- the type of instance contained in the context
public interface Instantiator<T>A factory forCreationalContexts of a specific type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CreationalContext<T>create(Resolver<Injectable<?>> resolver)Creates aCreationalContext.KeygetElementKey()Returns theKeyof which individual elements of the injection target consist.ResolutiongetResolution()Returns how the injection target should be resolved.
-
-
-
Method Detail
-
create
CreationalContext<T> create(Resolver<Injectable<?>> resolver) throws CreationException, UnsatisfiedResolutionException, AmbiguousResolutionException, ScopeNotActiveException
Creates aCreationalContext.- Parameters:
resolver- aResolver, cannot benull- Returns:
- a
CreationalContext, nevernull - Throws:
CreationException- when an error occurred during creation of a matching instanceUnsatisfiedResolutionException- when no matching instance was available or could be createdAmbiguousResolutionException- when multiple matching instances were availableScopeNotActiveException- when the scope for the produced type is not active
-
getResolution
Resolution getResolution()
Returns how the injection target should be resolved.- Returns:
- a
Resolution, nevernull
-
getElementKey
Key getElementKey()
Returns theKeyof which individual elements of the injection target consist. For simple types, this will be the same as the injection target's type. For types which are provided by an injection target extension, this will be base type that is looked up for injection.- Returns:
- a
Key, nevernull
-
-