Interface ExtensionFactory

All Known Implementing Classes:
SqlObjectFactory

public interface ExtensionFactory
Factory interface used to produce Jdbi extension objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(Class<?> extensionType)
    Returns true if the factory can attach the given extension type.
    <E> E
    attach(Class<E> extensionType, HandleSupplier handle)
    Attaches an extension type.
  • Method Details

    • accepts

      boolean accepts(Class<?> extensionType)
      Returns true if the factory can attach the given extension type.
      Parameters:
      extensionType - the extension type.
      Returns:
      whether the factory can produce an extension of the given type.
    • attach

      <E> E attach(Class<E> extensionType, HandleSupplier handle)
      Attaches an extension type.
      Type Parameters:
      E - the extension type
      Parameters:
      extensionType - the extension type.
      handle - Supplies the database handle. This supplier may lazily open a Handle on the first invocation. Extension implementors should take care not to fetch the handle before it is needed, to avoid opening handles unnecessarily.
      Returns:
      an extension of the given type, attached to the given handle.
      Throws:
      IllegalArgumentException - if the extension type is not supported by this factory.
      See Also: