Package org.jdbi.v3.core.extension
Enum ExtensionFactory.FactoryFlag
- java.lang.Object
-
- java.lang.Enum<ExtensionFactory.FactoryFlag>
-
- org.jdbi.v3.core.extension.ExtensionFactory.FactoryFlag
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ExtensionFactory.FactoryFlag>
- Enclosing interface:
- ExtensionFactory
@Alpha public static enum ExtensionFactory.FactoryFlag extends java.lang.Enum<ExtensionFactory.FactoryFlag>
Flags that the factory can return to control aspects of the extension framework.- Since:
- 3.38.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DONT_USE_PROXYDo not wrap the backing object methods intoExtensionHandlerinstances and return aProxyinstance but return it as is.NON_VIRTUAL_FACTORYThe factory provides a concrete instance to back the extension type.
-
Constructor Summary
Constructors Modifier Constructor Description privateFactoryFlag()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExtensionFactory.FactoryFlagvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ExtensionFactory.FactoryFlag[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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, theExtensionFactory.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 intoExtensionHandlerinstances and return aProxyinstance 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 Detail
-
values
public static ExtensionFactory.FactoryFlag[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ExtensionFactory.FactoryFlag c : ExtensionFactory.FactoryFlag.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ExtensionFactory.FactoryFlag valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-