Package org.jdbi.v3.core.extension
Interface ExtensionHandler
- All Known Subinterfaces:
ExtensionHandler.Simple,Handler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides functionality for a single method on an extension object. Each extension handler can either
call another piece of code to return the result (e.g. the method on the underlying object) or return the
result itself.
- Since:
- 3.38.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionattachTo(ConfigRegistry config, Object target) Attach this extension handler to a target instance.static ExtensionHandlercreateForMethod(Method method) Create an extension handler and bind it to a method that will be called on the target object when invoked.static ExtensionHandlercreateForMethodHandle(MethodHandle methodHandle) Create an extension handler and bind it to aMethodHandleinstance.static ExtensionHandlercreateForSpecialMethod(Method method) Create an extension handler and bind it to a special method that will be called on the target object when invoked.static ExtensionHandlermissingExtensionHandler(Method method) Returns a default handler for missing functionality.
-
Method Details
-
attachTo
Attach this extension handler to a target instance.- Parameters:
config- the configuration at time of attachtarget- the target object on which the handler should operate
-
missingExtensionHandler
Returns a default handler for missing functionality. The handler will throw an exception when invoked.- Parameters:
method- The method to which this specific handler instance is bound- Returns:
- An
ExtensionHandlerinstance
-
createForMethod
Create an extension handler and bind it to a method that will be called on the target object when invoked.- Parameters:
method- TheMethodto bind to- Returns:
- An
ExtensionHandler - Throws:
IllegalAccessException- If the method could not be unreflected
-
createForSpecialMethod
Create an extension handler and bind it to a special method that will be called on the target object when invoked. This is needed e.g. for interface default methods.- Parameters:
method- TheMethodto bind to- Returns:
- An
ExtensionHandler - Throws:
IllegalAccessException- If the method could not be unreflected
-
createForMethodHandle
Create an extension handler and bind it to aMethodHandleinstance.- Parameters:
methodHandle- TheMethodHandleto bind to- Returns:
- An
ExtensionHandler
-