Enum ExtensionFactory.FactoryFlag

java.lang.Object
java.lang.Enum<ExtensionFactory.FactoryFlag>
org.jdbi.v3.core.extension.ExtensionFactory.FactoryFlag
All Implemented Interfaces:
Serializable, Comparable<ExtensionFactory.FactoryFlag>
Enclosing interface:
ExtensionFactory

@Alpha public static enum ExtensionFactory.FactoryFlag extends Enum<ExtensionFactory.FactoryFlag>
Flags that the factory can return to control aspects of the extension framework.
Since:
3.38.0
  • Enum Constant Details

    • NON_VIRTUAL_FACTORY

      public static final ExtensionFactory.FactoryFlag NON_VIRTUAL_FACTORY
      The factory provides a concrete instance to back the extension type.
      Unless this flag is present, factories do not create an object to attach to but register method handlers for every method on an extension type.
      E.g. the SQLObject handler is an example of a virtual factory that processes every method in an interface class without requiring an implementation of the extension type. The extension framework will execute the method handlers and pass in a proxy object instead of an underlying instance.
      When this flag is present, the ExtensionFactory.attach(Class, HandleSupplier) method will never be called.
    • DONT_USE_PROXY

      public static final ExtensionFactory.FactoryFlag DONT_USE_PROXY
      Do not wrap the backing object methods into ExtensionHandler instances and return a Proxy instance but return it as is. This allows the factory to suport class objects as well as interfaces.
      This is a corner use case and should normally not be used by any standard extension.
      Legacy extension factories that need every method on an interface forwarded to the underlying implementation class can set this flag to bypass the proxy logic of the extension framework.
  • Method Details

    • values

      public static ExtensionFactory.FactoryFlag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ExtensionFactory.FactoryFlag valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null