Class SqlMethodHandlerFactory

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accepts​(java.lang.Class<?> extensionType, java.lang.reflect.Method method)
      Determines whether the factory can create an ExtensionHandler for combination of extension type and method.
      java.util.Optional<ExtensionHandler> createExtensionHandler​(java.lang.Class<?> sqlObjectType, java.lang.reflect.Method method)
      Returns an ExtensionHandler instance for a extension type and method combination.
      private Handler createHandler​(java.lang.Class<? extends Handler> handlerType, java.lang.Class<?> sqlObjectType, java.lang.reflect.Method method)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SqlMethodHandlerFactory

        SqlMethodHandlerFactory()
    • Method Detail

      • accepts

        public boolean accepts​(java.lang.Class<?> extensionType,
                               java.lang.reflect.Method method)
        Description copied from interface: ExtensionHandlerFactory
        Determines whether the factory can create an ExtensionHandler for combination of extension type and method.
        Specified by:
        accepts in interface ExtensionHandlerFactory
        Parameters:
        extensionType - The extension type class
        method - A method
        Returns:
        True if the factory can create an extension handler for extension type and method, false otherwise
      • createExtensionHandler

        public java.util.Optional<ExtensionHandler> createExtensionHandler​(java.lang.Class<?> sqlObjectType,
                                                                           java.lang.reflect.Method method)
        Description copied from interface: ExtensionHandlerFactory
        Returns an ExtensionHandler instance for a extension type and method combination.
        Specified by:
        createExtensionHandler in interface ExtensionHandlerFactory
        Parameters:
        sqlObjectType - The extension type class
        method - A method
        Returns:
        An ExtensionHandler instance wrapped into an Optional. 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 return Optional.of(extensionHandler} and never return Optional.empty()
      • createHandler

        private Handler createHandler​(java.lang.Class<? extends Handler> handlerType,
                                      java.lang.Class<?> sqlObjectType,
                                      java.lang.reflect.Method method)