Class ExtensionMetadata.Builder
java.lang.Object
org.jdbi.v3.core.extension.ExtensionMetadata.Builder
- Enclosing class:
ExtensionMetadata
Builder class for the
ExtensionMetadata object.
See ExtensionMetadata.builder(Class).- Since:
- 3.38.0
-
Method Summary
Modifier and TypeMethodDescriptionaddConfigCustomizerFactory(ConfigCustomizerFactory configCustomizerFactory) Adds anConfigCustomizerFactorythat will be used to find configuration customizers when thebuild()} method is called.addExtensionHandlerCustomizer(ExtensionHandlerCustomizer extensionHandlerCustomizer) Adds anExtensionHandlerCustomizerthat will be used to customize extension handlers when thebuild()} method is called.addExtensionHandlerFactory(ExtensionHandlerFactory extensionHandlerFactory) Adds anExtensionHandlerFactorythat will be used to find extension handlers when thebuild()} method is called.addInstanceConfigCustomizer(ConfigCustomizer configCustomizer) Add an instance specific configuration customizer.addMethodConfigCustomizer(Method method, ConfigCustomizer configCustomizer) Add a method specific configuration customizer.addMethodHandler(Method method, ExtensionHandler handler) Adds a new extension handler for a method.build()Creates a newExtensionMetadataobject.Class<?> Returns the extension type from the builder.setExtensionTypeMethods(Collection<Method> methods) Sets the methods of the extension type that need extension handlers.
-
Method Details
-
setExtensionTypeMethods
Sets the methods of the extension type that need extension handlers. By default, the builder discovers these methods through reflection whenbuild()is called. Code that already holds the methods of the extension type, such as code created by the Jdbi generator, can supply them here so that no reflective discovery takes place. This matters for GraalVM native image, where an unregistered type reports no methods.- Parameters:
methods- The methods of the extension type- Returns:
- The builder instance
- Since:
- 3.55.0
-
addExtensionHandlerFactory
public ExtensionMetadata.Builder addExtensionHandlerFactory(ExtensionHandlerFactory extensionHandlerFactory) Adds anExtensionHandlerFactorythat will be used to find extension handlers when thebuild()} method is called.- Parameters:
extensionHandlerFactory- AnExtensionHandlerFactoryinstance- Returns:
- The builder instance
-
addExtensionHandlerCustomizer
public ExtensionMetadata.Builder addExtensionHandlerCustomizer(ExtensionHandlerCustomizer extensionHandlerCustomizer) Adds anExtensionHandlerCustomizerthat will be used to customize extension handlers when thebuild()} method is called.- Parameters:
extensionHandlerCustomizer- AnExtensionHandlerCustomizerinstance- Returns:
- The builder instance
-
addConfigCustomizerFactory
public ExtensionMetadata.Builder addConfigCustomizerFactory(ConfigCustomizerFactory configCustomizerFactory) Adds anConfigCustomizerFactorythat will be used to find configuration customizers when thebuild()} method is called.- Parameters:
configCustomizerFactory- AnConfigCustomizerFactoryinstance- Returns:
- The builder instance
-
addInstanceConfigCustomizer
Add an instance specific configuration customizer. This customizer will be applied to all methods on the extension type.- Parameters:
configCustomizer- AConfigCustomizer- Returns:
- The builder instance
-
addMethodConfigCustomizer
public ExtensionMetadata.Builder addMethodConfigCustomizer(Method method, ConfigCustomizer configCustomizer) Add a method specific configuration customizer. This customizer will be applied only to the method given here.- Parameters:
method- A method objectconfigCustomizer- AConfigCustomizer- Returns:
- The builder instance
-
addMethodHandler
Adds a new extension handler for a method.- Parameters:
method- The method for which an extension handler should be registered.handler- AnExtensionHandlerinstance- Returns:
- The builder instance
-
getExtensionType
Returns the extension type from the builder.- Returns:
- The extension type
-
build
Creates a newExtensionMetadataobject.- Returns:
- A
ExtensionMetadataobject
-