Specific method to add a multisite route to the collection.

Paths option should not be null.
324073
protected function addMultisiteRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method)
    {
        $paths = $this->siteContext->normalizePaths($annot->getPaths());

        foreach ($paths as $branding => $locales) {
            foreach ($locales as $locale => $path) {

                // this block of code is copied from Symfony\Component\Routing\Loader\AnnotationFileLoader
                $name = $annot->getName();
                if (null === $name) {
                    $name = $this->getDefaultRouteName($class, $method);
                }
                $name = MultisiteRouter::ROUTE_PREFIX.'_'.$branding.'_'.$locale.'__'.$name;

                $defaults = array_replace($globals['defaults'], $annot->getDefaults());
                foreach ($method->getParameters() as $param) {
                    if (!isset($defaults[$param->getName()]) && $param->isOptional()) {
                        $defaults[$param->getName()] = $param->getDefaultValue();
                    }
                }

                // +2 lines
                $defaults['_branding'] = $branding;
                $defaults['_locale']   = $locale;

                $requirements = array_replace($globals['requirements'], $annot->getRequirements());
                $options = array_replace($globals['options'], $annot->getOptions());
                $schemes = array_replace($globals['schemes'], $annot->getSchemes());
                $methods = array_replace($globals['methods'], $annot->getMethods());

                $host = $annot->getHost();
                if (null === $host) {
                    $host = $globals['host'];
                }

                // +3 lines
                if (!$host) {
                    $host = $this->siteContext->getBranding($branding)->getHost($locale);
                }

                $condition = $annot->getCondition();
                if (null === $condition) {
                    $condition = $globals['condition'];
                }

                $route = new Route($globals['path'].$path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
                $this->configureRoute($route, $class, $method, $annot);

                $collection->add($name, $route);
            }
        }

        // cache will refresh when file is modified
        $collection->addResource(new FileResource($class->getFileName()));

        return $collection;
    }
1201327
protected function addToCollections($route)
    {
        $domainAndUri = $route->getDomain().$route->uri();

        if ($route->hasCondition() && ! empty($route->getConditionParameters())) {
            $domainAndUri .= serialize($route->getConditionParameters());
        }

        foreach ($route->methods() as $method) {
            $this->routes[$method][$domainAndUri] = $route;
        }

        $this->allRoutes[$method.$domainAndUri] = $route;
    }
438904
def add_route_for_all_verbs(path, controller)
      add_route('GET', path, controller)
      add_route('POST', path, controller)
      add_route('DELETE', path, controller)
      add_route('PUT', path, controller)
    end
1119268
public void addUrls(Collection<URL> urls) {
		Assert.notNull(urls, "Urls must not be null");
		this.urls.addAll(urls);
	}
706092
def add_route(route, endpoint=None, **kw):
    
    def wrapper(f):
        try:
            router.DefaultRouter.add_url_rule(route,
                                              endpoint=endpoint,
                                              view_func=f,
                                              options=kw)
        except AssertionError, e:
            logger.warn("Failed to register route {}: {}".format(route, e))
        return f
    return wrapper
1130750
public function addRoutes(\FreeFW\Router\RouteCollection $p_collection)
    {
        $this->routes->addRoutes($p_collection);
        return $this;
    }
1308930
function addPathContext(pathContexts) {
  _each(pathContexts, pathContext => {
    if (pathContext.paths) {
      pathContext.paths = _arrayify(pathContext.paths)
    }

    if (pathContext.regexes) {
      pathContext.regexes = _arrayify(pathContext.regexes)
    }

    if (pathContext.contexts) {
      pathContext.contexts = _arrayify(pathContext.contexts)
    }
  })
  _addUniqueItems(_pathContexts, pathContexts)
  return _pathContexts
}
1231168
public LocationBuilder addAllPath(final ParserRuleContext ctx, final ParseTree... parts) {
    location.addAllSpan(getSpan(ctx));

    // FIXME
    if (parts != null && parts.length > 0) {
      for (final ParseTree parseTree : parts) {
        location
            .addAllSpan(parseTree instanceof ParserRuleContext ? getSpan((ParserRuleContext) parseTree)
                : getSpan((TerminalNode) parseTree));
      }
    }

    return this;
  }
1354536
def add_path(self, path):
        """"""
        if not os.path.exists(path):
            raise RuntimeError('Path does not exists: %s.' % path)
        self.paths.append(path)
1248264
def add_collection(self, path, c_name, c_type, c_doc, c_version="unknown",
                       c_scope="", c_namedargs="yes", c_doc_format="ROBOT"):
        """"""
        if path is not None:
            # We want to store the normalized form of the path in the
            # database
            path = os.path.abspath(path)

        cursor = self.db.cursor()
        cursor.execute("""
            INSERT INTO collection_table
                (name, type, version, scope, namedargs, path, doc, doc_format)
            VALUES
                (?,?,?,?,?,?,?,?)
        """, (c_name, c_type, c_version, c_scope, c_namedargs, path, c_doc, c_doc_format))
        collection_id = cursor.lastrowid
        return collection_id
118607
public UrlStringBuilder addPath(String... elements) {
        Validate.noNullElements(elements, "elements cannot be null");

        for (final String element : elements) {
            this.path.add(element);
        }
        return this;
    }
676127
private Route _build() {
        Preconditions.checkNotNull(controller);
        Preconditions.checkNotNull(httpMethod);
        Preconditions.checkNotNull(uri);
        Preconditions.checkNotNull(httpMethod);

        return new Route(httpMethod, uri, controller, controllerMethod);
    }
1071736
def setup_versioned_routes(routes, version=None):
    """"""
    prefix = '/' + version if version else ""
    for r in routes:
        path, method = r
        route(prefix + path, method, routes[r])
252848
protected function addToCollections($route)
    {
        $domainAndUri = $route->getDomain().$route->uri();

        foreach ($route->methods() as $method) {
            $this->routes[$method][$domainAndUri] = $route;
        }

        $this->allRoutes[$method.$domainAndUri] = $route;
    }
774628
private function addPaths(bool $v3, \ArrayObject $paths, \ArrayObject $definitions, string $resourceClass, string $resourceShortName, ResourceMetadata $resourceMetadata, array $mimeTypes, string $operationType, \ArrayObject $links)
    {
        if (null === $operations = OperationType::COLLECTION === $operationType ? $resourceMetadata->getCollectionOperations() : $resourceMetadata->getItemOperations()) {
            return;
        }

        foreach ($operations as $operationName => $operation) {
            $path = $this->getPath($resourceShortName, $operationName, $operation, $operationType);
            $method = OperationType::ITEM === $operationType ? $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName) : $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);

            $paths[$path][strtolower($method)] = $this->getPathOperation($v3, $operationName, $operation, $method, $operationType, $resourceClass, $resourceMetadata, $mimeTypes, $definitions, $links);
        }
    }
131203
def _add_url_route(self, endpoint, rule, view_func, method):
        
        if self.api_prefix:
            rule = self.api_prefix + rule

        if self.endpoint_prefix:
            endpoint = self.endpoint_prefix + endpoint

        self.app.add_url_rule(
            rule,
            endpoint,
            self._apply_auth(view_func),
            methods=[method]
        )
535791
def add_route(route, endpoint=None, **kw):
    

    # ensure correct amout of slashes
    def apiurl(route):
        return '/'.join(s.strip('/') for s in ["", BASE_URL, route])

    return add_senaite_route(apiurl(route), endpoint, **kw)