Class ExtensionMetadata

java.lang.Object
org.jdbi.v3.core.extension.ExtensionMetadata

@Alpha public final class ExtensionMetadata extends Object
Metadata that was detected when analyzing an extension class before attaching. Represents a resolved extension type with all config customizers and method handlers.
Since:
3.38.0
  • Method Details

    • builder

      public static ExtensionMetadata.Builder builder(Class<?> extensionType)
      Returns a new ExtensionMetadata.Builder instance.
      Parameters:
      extensionType - The extension type for which metadata is collected
      Returns:
      A new ExtensionMetadata.Builder instance
    • extensionType

      public Class<?> extensionType()
    • createInstanceConfiguration

      public ConfigRegistry createInstanceConfiguration(ConfigRegistry config)
      Create an instance specific configuration based on all instance customizers. The instance configuration holds all custom configuration that was applied e.g. through instance annotations.
      Parameters:
      config - A configuration object. The object is not changed
      Returns:
      A new configuration object with all changes applied
    • createMethodConfiguration

      public ConfigRegistry createMethodConfiguration(Method method, ConfigRegistry config)
      Create an method specific configuration based on all method customizers. The method configuration holds all custom configuration that was applied e.g. through method annotations.
      Parameters:
      method - The method that is about to be called
      config - A configuration object. The object is not changed
      Returns:
      A new configuration object with all changes applied
    • getExtensionMethods

      public Set<Method> getExtensionMethods()
      Returns a set of all Methods that have ExtensionHandler objects associated with them.
    • createExtensionHandlerInvoker

      public <E> ExtensionMetadata.ExtensionHandlerInvoker createExtensionHandlerInvoker(E target, Method method, HandleSupplier handleSupplier, ConfigRegistry config)
      Creates an ExtensionMetadata.ExtensionHandlerInvoker instance for a specific method.
      Type Parameters:
      E - THe type of the target object
      Parameters:
      target - The target object on which the invoker should work
      method - The method which will trigger the invocation
      handleSupplier - A HandleSupplier that will provide the handle object for the extension method
      config - The configuration object which should be used as base for the method specific configuration
      Returns:
      A ExtensionMetadata.ExtensionHandlerInvoker object that is linked to the method