Class AbstractJdbiDefinitionModule
- All Implemented Interfaces:
- Module,- JdbiBinder
Jdbi instances. This is a PrivateModule which will by default only expose the constructed Jdbi object as
 a binding. Everything configured within this module is private to the module and not exposed. This allows installation of multiple instances of modules that
 extend the AbstractJdbiDefinitionModule base class.
 
 Each module requires a DataSource bound using the same annotation or annotation class as used on the module constructor. If this data source is not
 present, the injection process will fail.
 
 Successful binding will expose a Jdbi binding annotated with the same annotation or annotation class as used on the module constructor. Additional
 elements defined in this module can be exposed using the exposeBinding(Class) is called within the configureJdbi() method.
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractJdbiDefinitionModule(Annotation annotation) Create a Jdbi definition module.AbstractJdbiDefinitionModule(Annotation annotation, Class<? extends Annotation> globalAnnotationClass) Create a Jdbi definition module with a custom annotation for element configuration.AbstractJdbiDefinitionModule(Class<? extends Annotation> annotationClass) Create a Jdbi definition module.AbstractJdbiDefinitionModule(Class<? extends Annotation> annotationClass, Class<? extends Annotation> globalAnnotationClass) Create a Jdbi definition module with a custom annotation for element configuration.
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidOverride this method to configure all aspects of a Jdbi instance.final <T> Key<T>createKey(TypeLiteral<T> type) Creates aKeyobject for aTypeLiteralthat uses the annotation or annotation class used to construct this module.final <T> Key<T>Creates aKeyobject for a class that uses the annotation or annotation class used to construct this module.final <T> voidexposeBinding(TypeLiteral<T> type) Exposes a binding that is in module scope (without annotations) and binds it using either the annotation or annotation class and then exposes it outside the module.final <T> voidexposeBinding(Class<T> clazz) Exposes a binding that is in module scope (without annotations) and binds it using either the annotation or annotation class and then exposes it outside the module.final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T>importBinding(LinkedBindingBuilder<T> binder, TypeLiteral<T> type) Pulls an existing outside binding into the module scope using the specified binder.final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T>importBinding(LinkedBindingBuilder<T> binder, Class<T> clazz) Pulls an existing outside binding into the module scope using the specified binder.final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T>importBinding(TypeLiteral<T> type) Pulls an existing outside binding into the module scope.final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T>importBinding(Class<T> clazz) Pulls an existing outside binding into the module scope.final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T>importBindingLoosely(LinkedBindingBuilder<T> binder, TypeLiteral<T> type) Pulls an outside binding into the module scope if it exists using the binder given.final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T>importBindingLoosely(LinkedBindingBuilder<T> binder, Class<T> clazz) Pulls an outside binding into the module scope if it exists using the binder given.final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T>importBindingLoosely(TypeLiteral<T> type) Pulls an outside binding into the module scope if it exists.final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T>importBindingLoosely(Class<T> clazz) Pulls an outside binding into the module scope if it exists.final JdbiBinderProvides access to theJdbiBinderinstance.Methods inherited from class com.google.inject.PrivateModuleconfigureMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.guice.JdbiBinderbindArrayType, bindCodec, bindCodec, bindCodec, bindColumnMapper, bindColumnMapper, bindColumnMapper, bindColumnMapper, bindCustomizer, bindPlugin, bindRowMapper, bindRowMapper, bindRowMapper
- 
Constructor Details- 
AbstractJdbiDefinitionModuleCreate a Jdbi definition module.A Jdbi definition module that uses this constructor will use the default element configuration from AbstractJdbiConfigurationModules that do not use any custom annotation.- Parameters:
- annotation- The resulting- Jdbiinstance will be exposed using this annotation.
 
- 
AbstractJdbiDefinitionModulepublic AbstractJdbiDefinitionModule(Annotation annotation, Class<? extends Annotation> globalAnnotationClass) Create a Jdbi definition module with a custom annotation for element configuration.A Jdbi definition module that uses this constructor will use the element configuration from AbstractJdbiConfigurationModules that use the same annotation as this constructor.
- 
AbstractJdbiDefinitionModuleCreate a Jdbi definition module.A Jdbi definition module that uses this constructor will use the default element configuration from AbstractJdbiConfigurationModules that do not use any custom annotation.- Parameters:
- annotationClass- The resulting- Jdbiinstance will be exposed using this annotation class.
 
- 
AbstractJdbiDefinitionModulepublic AbstractJdbiDefinitionModule(Class<? extends Annotation> annotationClass, Class<? extends Annotation> globalAnnotationClass) Create a Jdbi definition module with a custom annotation for element configuration.A Jdbi definition module that uses this constructor will use the element configuration from AbstractJdbiConfigurationModules that use the same annotation as this constructor.
 
- 
- 
Method Details- 
configureJdbipublic abstract void configureJdbi()Override this method to configure all aspects of a Jdbi instance.@Override protected void configureJdbi() { bindPlugin().toInstance(...); bindTransformer().to(...); bindRowMapper().to(...); }
- 
jdbiBinderProvides access to theJdbiBinderinstance.Only valid when called from configureJdbi().- Specified by:
- jdbiBinderin interface- JdbiBinder
 
- 
importBindingLooselypublic final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T> importBindingLoosely(TypeLiteral<T> type) Pulls an outside binding into the module scope if it exists. If it does not exist, bind a null value or a default. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingLooselypublic final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T> importBindingLoosely(Class<T> clazz) Pulls an outside binding into the module scope if it exists. If it does not exist, bind a null value or a default. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingLooselypublic final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T> importBindingLoosely(LinkedBindingBuilder<T> binder, TypeLiteral<T> type) Pulls an outside binding into the module scope if it exists using the binder given. If it does not exist, bind a null value or a default. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingLooselypublic final <T> org.jdbi.v3.guice.internal.InternalLooseImportBindingBuilder<T> importBindingLoosely(LinkedBindingBuilder<T> binder, Class<T> clazz) Pulls an outside binding into the module scope if it exists using the binder given. If it does not exist, bind a null value or a default. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingpublic final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T> importBinding(Class<T> clazz) Pulls an existing outside binding into the module scope. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingpublic final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T> importBinding(TypeLiteral<T> type) Pulls an existing outside binding into the module scope. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingpublic final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T> importBinding(LinkedBindingBuilder<T> binder, TypeLiteral<T> type) Pulls an existing outside binding into the module scope using the specified binder. An outside binding uses the same annotation or annotation class as the module.
- 
importBindingpublic final <T> org.jdbi.v3.guice.internal.InternalImportBindingBuilder<T> importBinding(LinkedBindingBuilder<T> binder, Class<T> clazz) Pulls an existing outside binding into the module scope using the specified binder. An outside binding uses the same annotation or annotation class as the module.
- 
createKeyCreates aKeyobject for a class that uses the annotation or annotation class used to construct this module.
- 
createKeyCreates aKeyobject for aTypeLiteralthat uses the annotation or annotation class used to construct this module.
- 
exposeBindingExposes a binding that is in module scope (without annotations) and binds it using either the annotation or annotation class and then exposes it outside the module.
- 
exposeBindingExposes a binding that is in module scope (without annotations) and binds it using either the annotation or annotation class and then exposes it outside the module.
 
-