Package org.jdbi.v3.sqlobject
Class GeneratorSqlObjectFactory
java.lang.Object
org.jdbi.v3.sqlobject.GeneratorSqlObjectFactory
- All Implemented Interfaces:
ExtensionFactory
,org.jdbi.v3.core.internal.OnDemandExtensions.Factory
public final class GeneratorSqlObjectFactory
extends Object
implements org.jdbi.v3.core.internal.OnDemandExtensions.Factory
Support for generator instances (concrete classes that have been created by the Jdbi generator).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jdbi.v3.core.extension.ExtensionFactory
ExtensionFactory.FactoryFlag
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the factory can process the given extension type.<E> E
attach
(Class<E> extensionType, HandleSupplier handleSupplier) Attach a sql object from a jdbi generator created class.void
Receives theExtensionMetadata.Builder
when theExtensionMetadata
object for this extension is created.Returns a collection ofConfigCustomizerFactory
objects.Returns a collection ofExtensionHandlerCustomizer
objects.Returns a collection ofExtensionHandlerFactory
objects.Returns a set ofExtensionFactory.FactoryFlag
s that describe the extension factory.
-
Method Details
-
accepts
Description copied from interface:ExtensionFactory
Returns true if the factory can process the given extension type.- Specified by:
accepts
in interfaceExtensionFactory
- Parameters:
extensionType
- the extension type- Returns:
- whether the factory can produce an extension of the given type
-
getFactoryFlags
Description copied from interface:ExtensionFactory
Returns a set ofExtensionFactory.FactoryFlag
s that describe the extension factory.- Specified by:
getFactoryFlags
in interfaceExtensionFactory
- Returns:
- A set of
ExtensionFactory.FactoryFlag
elements. Default is the empty set
-
attach
Attach a sql object from a jdbi generator created class.- Specified by:
attach
in interfaceExtensionFactory
- Type Parameters:
E
- the extension type- Parameters:
extensionType
- the type of sql object to create.handleSupplier
- the Handle instance to attach this sql object to.- Returns:
- the new sql object bound to this handle.
- See Also:
-
onDemand
- Specified by:
onDemand
in interfaceorg.jdbi.v3.core.internal.OnDemandExtensions.Factory
-
buildExtensionMetadata
Description copied from interface:ExtensionFactory
Receives theExtensionMetadata.Builder
when theExtensionMetadata
object for this extension is created. The factory can add additional method handlers or specific instance and method customizers as needed.
Code here can call methods on the builder to configure the metadata object.- Specified by:
buildExtensionMetadata
in interfaceExtensionFactory
- Parameters:
builder
- The builder object that is used to create theExtensionMetadata
object
-
getExtensionHandlerCustomizers
Description copied from interface:ExtensionFactory
Returns a collection ofExtensionHandlerCustomizer
objects. These customizers are used in addition to the customizers that have been registered withExtensions.registerHandlerCustomizer(org.jdbi.v3.core.extension.ExtensionHandlerCustomizer)
.
Handler customizers returned here can customize the behavior of the Handlers returned by the handler factories.- Specified by:
getExtensionHandlerCustomizers
in interfaceExtensionFactory
- Parameters:
config
- A Configuration registry object that can be used to look up additional information- Returns:
- A collection of
ExtensionHandlerCustomizer
objects. Can be empty, must not be null
-
getExtensionHandlerFactories
Description copied from interface:ExtensionFactory
Returns a collection ofExtensionHandlerFactory
objects. These factories are used in addition to the factories that have been registered withExtensions.registerHandlerFactory(org.jdbi.v3.core.extension.ExtensionHandlerFactory)
.
Handler factories returned here can customize the behavior of the Extension factory itself.- Specified by:
getExtensionHandlerFactories
in interfaceExtensionFactory
- Parameters:
config
- A Configuration registry object that can be used to look up additional information- Returns:
- A collection of
ExtensionHandlerFactory
objects. Can be empty, must not be null
-
getConfigCustomizerFactories
Description copied from interface:ExtensionFactory
Returns a collection ofConfigCustomizerFactory
objects.
Each factory is called once for every type that is attached by the factory and once for each method in the type. They can returnConfigCustomizer
instances that will affect the specific configuration for each method and extension type.- Specified by:
getConfigCustomizerFactories
in interfaceExtensionFactory
- Parameters:
config
- A Configuration registry object that can be used to look up additional information- Returns:
- A collection of
ConfigCustomizerFactory
objects. Can be empty, must not be null
-