Package org.jdbi.v3.core.extension
Class UseAnnotationExtensionHandlerFactory
java.lang.Object
org.jdbi.v3.core.extension.UseAnnotationExtensionHandlerFactory
- All Implemented Interfaces:
ExtensionHandlerFactory
Processes
UseExtensionHandler annotations on methods.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the factory can create anExtensionHandlerfor combination of extension type and method.createExtensionHandler(Class<?> extensionType, Method method) Returns anExtensionHandlerinstance for a extension type and method combination.private ExtensionHandlercreateExtensionHandler(Class<? extends ExtensionHandler> handlerType, Class<?> extensionObjectType, Method method) findAnnotations(Method method) private static boolean
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
UseAnnotationExtensionHandlerFactory
UseAnnotationExtensionHandlerFactory()
-
-
Method Details
-
accepts
Description copied from interface:ExtensionHandlerFactoryDetermines whether the factory can create anExtensionHandlerfor combination of extension type and method.- Specified by:
acceptsin interfaceExtensionHandlerFactory- Parameters:
extensionType- The extension type classmethod- A method- Returns:
- True if the factory can create an extension handler for extension type and method, false otherwise
-
matchAnnotation
-
findAnnotations
-
createExtensionHandler
Description copied from interface:ExtensionHandlerFactoryReturns anExtensionHandlerinstance for a extension type and method combination.- Specified by:
createExtensionHandlerin interfaceExtensionHandlerFactory- Parameters:
extensionType- The extension type classmethod- A method- Returns:
- An
ExtensionHandlerinstance wrapped into anOptional. The optional can be empty. This is necessary to retrofit old code that does not have an accept/build code pair but unconditionally tries to build a handler and returns empty if it can not. New code should always returnOptional.of(extensionHandler}and never returnOptional.empty()
-
createExtensionHandler
private ExtensionHandler createExtensionHandler(Class<? extends ExtensionHandler> handlerType, Class<?> extensionObjectType, Method method)
-