Package org.iworkz.genesis.impl
Class AbstractInjector
java.lang.Object
org.iworkz.genesis.impl.AbstractInjector
- All Implemented Interfaces:
Injector
- Direct Known Subclasses:
DefaultInjector
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected <T> Tget(Class<T> instanceClass, boolean isProvider, AnnotatedElement annotatedElement, InjectionContext ctx) Module[]getContext(Class<?> scope) <T> Class<? extends T>getImplementationClass(Class<T> injectedClass) Returns the implementation class for the giventype<T> Class<? extends T>getImplementationClass(String className) Returns the implementation class for the given name<T> TgetInstance(Class<T> instanceClass) Returns the appropriate instance for the giventype<T> TgetInstance(String className) Returns the appropriate instance for the given nameprotected AnnotationgetNameAnnotation(AnnotatedElement annotatedElement) protected AnnotationgetQualifierAnnotation(AnnotatedElement annotatedElement) protected <T extends Annotation>
ValueSupplier<T,?> getValueSupplier(Class<T> annotation) voidinjectMembers(Object instance) Injects dependencies into the fields and methods ofinstance.protected voidinjectMembers(Object instance, Class<?> classWithMembers, InjectionContext ctx) protected booleanisInjected(AccessibleObject field) protected booleanisScopeAnnotation(Class<? extends Annotation> annotationType) protected booleanisSingleton(Class<? extends Annotation> scopeAnnotationType) <T> Class<? extends T>protected voidvoidpostProcess(PostProcessor postProcessor, Map<Object, Set<Object>> createdInstances) protected voidSupports the bootstrapping of the Injector.protected voidsetup()
-
Field Details
-
modulesForSetup
-
-
Constructor Details
-
AbstractInjector
-
-
Method Details
-
getConfiguredModules
-
setup
protected void setup() -
postSetup
protected void postSetup()Supports the bootstrapping of the Injector. Here the injector can already be used (e.g. for internal injections) but it is not available for external use. -
createPreliminaryReflectionHelper
protected void createPreliminaryReflectionHelper() -
createFinalReflectionHelper
protected void createFinalReflectionHelper() -
configureImplementationFinders
protected void configureImplementationFinders() -
injectMembers
Description copied from interface:InjectorInjects dependencies into the fields and methods ofinstance. An injectable constructor is ignored.- Specified by:
injectMembersin interfaceInjector
-
postProcess
-
postProcess
-
isInjected
-
injectMembers
-
getInstance
Description copied from interface:InjectorReturns the appropriate instance for the giventype- Specified by:
getInstancein interfaceInjector- Returns:
-
getImplementationClass
Description copied from interface:InjectorReturns the implementation class for the given name- Specified by:
getImplementationClassin interfaceInjector- Returns:
-
loadClass
-
getInstance
Description copied from interface:InjectorReturns the appropriate instance for the given name- Specified by:
getInstancein interfaceInjector- Returns:
-
getQualifierAnnotation
-
get
protected <T> T get(Class<T> instanceClass, boolean isProvider, AnnotatedElement annotatedElement, InjectionContext ctx) -
getImplementationClass
Description copied from interface:InjectorReturns the implementation class for the giventype- Specified by:
getImplementationClassin interfaceInjector- Returns:
-
getContext
-
getValueSupplier
-
isScopeAnnotation
-
isSingleton
-
getNameAnnotation
-