public function registerNamedRoute(Route $routeObj)
    {
        $name = $routeObj->getName();
        if ($name && isset($this->namedRoutes[$name])) {
            if ($routeObj !== $this->namedRoutes[$name]) {
                throw new Exception("Can not redeclare route '{$name}'");
            }
        } else {
            $this->namedRoutes[$name] = $routeObj;
        }
    }