public function registerHandlersFromConfig()
    {
        $config = $this->container->getConfigInstance();
        foreach ($config->getAJAXTypeHandlers() as $handlerArray) {

            if (isset($handlerArray['path'])) {
                $path = $handlerArray['path'];
                if (!file_exists($path)) {
                    throw new FileNotFoundException($path, "AJAXTypeHandler class file");
                }
                /** @noinspection PhpIncludeInspection */
                require_once $path;
            }

            $className = $handlerArray['class_name'];

            if (!class_exists($className)) {
                throw new ClassNotDefinedException($className);
            }

            $handler = new $className($this->container);

            if($handler instanceof TypeHandlerGenerator){
                $handler = $handler->generateTypeHandler();
            }

            if (!($handler instanceof TypeHandler)) {
                throw new ClassNotInstanceOfException($handler == null ? 'null' : get_class($handler), 'AJAXTypeHandler');
            }

            $this->registerHandler($handler);
        }
    }