Package ru.vyarus.guicey.jdbi3.inject
Class InjectionHandlerFactory
- java.lang.Object
-
- ru.vyarus.guicey.jdbi3.inject.InjectionHandlerFactory
-
- All Implemented Interfaces:
org.jdbi.v3.core.extension.ExtensionHandlerFactory
public class InjectionHandlerFactory extends java.lang.Object implements org.jdbi.v3.core.extension.ExtensionHandlerFactorySql objects are forced to be interfaces now so it is impossible to inject guice bean (probably other proxy) with field injection. In order to workaround this limitation getter injection must be used:@Inject MyBean getBean();. Handler detects methods annotated withInjectorInjectand return actual guice bean on method call.- Since:
- 17.09.2018
-
-
Constructor Summary
Constructors Constructor Description InjectionHandlerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(java.lang.Class<?> extensionType, java.lang.reflect.Method method)java.util.Optional<org.jdbi.v3.core.extension.ExtensionHandler>createExtensionHandler(java.lang.Class<?> extensionType, java.lang.reflect.Method method)
-
-
-
Method Detail
-
accepts
public boolean accepts(java.lang.Class<?> extensionType, java.lang.reflect.Method method)- Specified by:
acceptsin interfaceorg.jdbi.v3.core.extension.ExtensionHandlerFactory
-
createExtensionHandler
public java.util.Optional<org.jdbi.v3.core.extension.ExtensionHandler> createExtensionHandler(java.lang.Class<?> extensionType, java.lang.reflect.Method method)- Specified by:
createExtensionHandlerin interfaceorg.jdbi.v3.core.extension.ExtensionHandlerFactory
-
-