判断是否需要排除系统过滤器

@param customRouters 自定义Router
@return 是否排除
167013
private static HashSet<String> parseExcludeRouter(List<Router> customRouters) {
        HashSet<String> excludeKeys = new HashSet<String>();
        if (CommonUtils.isNotEmpty(customRouters)) {
            for (Router router : customRouters) {
                if (router instanceof ExcludeRouter) {
                    // 存在需要排除的过滤器
                    ExcludeRouter excludeRouter = (ExcludeRouter) router;
                    String excludeName = excludeRouter.getExcludeName();
                    if (StringUtils.isNotEmpty(excludeName)) {
                        String excludeRouterName = startsWithExcludePrefix(excludeName) ? excludeName.substring(1)
                            : excludeName;
                        if (StringUtils.isNotEmpty(excludeRouterName)) {
                            excludeKeys.add(excludeRouterName);
                        }
                    }
                    customRouters.remove(router);
                }
            }
        }
        if (!excludeKeys.isEmpty()) {
            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Find exclude routers: {}", excludeKeys);
            }
        }
        return excludeKeys;
    }
565756
public static Reader reader(Format type, InputStream in, Map<String, ReadHandler<?, ?>> customHandlers) {
        return reader(type, in, customHandlers, null);
    }
1298216
public final B serverAddresses(Iterable<InetSocketAddress> serverAddresses) {
        requireNonNull(serverAddresses, "serverAddresses");
        final DnsServerAddresses addrs = DnsServerAddresses.sequential(serverAddresses);
        serverAddressStreamProvider = hostname -> addrs.stream();
        return self();
    }
135715
public static Router getRouter(Class<? extends Router> routerType) {
    return routers.computeIfAbsent(routerType, Routers::create);
  }
181459
public GetStageResult withRouteSettings(java.util.Map<String, RouteSettings> routeSettings) {
        setRouteSettings(routeSettings);
        return this;
    }
1214793
def subrouters(self):
        
        yield from filter(lambda mw: isinstance(mw.func, Router), self.mw_list)
1082124
public Map<String, String> getCustomRequestHeaders() {
        if (customRequestHeaders == null) {
            return null;
        }
        return Collections.unmodifiableMap(customRequestHeaders);
    }
797995
private ViewableContext getViewableContext() {
        final Set<ViewableContext> customProviders =
                Providers.getCustomProviders(injectionManager, ViewableContext.class);
        if (!customProviders.isEmpty()) {
            return customProviders.iterator().next();
        }
        return Providers.getProviders(injectionManager, ViewableContext.class).iterator().next();
    }
1326053
@Bean
    public HttpHeadersProvider customHttpHeadersProvider() {
        return instance -> {
            HttpHeaders httpHeaders = new HttpHeaders();
            httpHeaders.add("X-CUSTOM", "My Custom Value");
            return httpHeaders;
        };
    }
181504
public java.util.List<TransitGatewayRoute> getRoutes() {
        if (routes == null) {
            routes = new com.amazonaws.internal.SdkInternalList<TransitGatewayRoute>();
        }
        return routes;
    }
905972
public Map<String, String[]> getParameterMap() {
		// JSR 289 Section 5.6.1 Parameters :
		// For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header.
		// For initial requests where the application is invoked the parameters are those present on the request URI, 
		// if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined.
		// For subsequent requests in a dialog, the parameters presented to the application  are those that the application itself 
		// set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). 
		// These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a 
		// "strict router" they may be returned in the request URI (see RFC 3261). 
		// It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly.
		HashMap<String, String[]> retval = new HashMap<String, String[]>();
		if(this.getPoppedRoute() != null) {
			Iterator<String> parameterNamesIt =  this.getPoppedRoute().getURI().getParameterNames();
			while (parameterNamesIt.hasNext()) {
				String parameterName = parameterNamesIt.next();
				String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[]
				retval.put(parameterName, paramsArray); 
			}
		} else {
			Iterator<String> parameterNamesIt =  this.getRequestURI().getParameterNames();
			while (parameterNamesIt.hasNext()) {
				String parameterName = parameterNamesIt.next();
				String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[]
				retval.put(parameterName, paramsArray);
			}
		}		
		
		return retval;
	}
665839
public java.util.List<RouteFilterPrefix> getRouteFilterPrefixes() {
        if (routeFilterPrefixes == null) {
            routeFilterPrefixes = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return routeFilterPrefixes;
    }
570346
function getUriMappers (serviceLocator) {
  var routeDefinitions;

  try {
    routeDefinitions = serviceLocator.resolveAll('routeDefinition');
  } catch (e) {
    routeDefinitions = [];
  }

  return routeDefinitions
    .map(route => {
      var mapper = routeHelper.compileRoute(route.expression);

      return {
        expression: mapper.expression,
        map: route.map || noop,
        argsMap: uri => {
          var args = mapper.map(uri);
          Object.assign(args, route.args);
          return args;
        }
      };
    });
}
825295
private List<RouteHandler> routePopulator() {
        // add global filters to all routes
        // currently, they are added AFTER already added filters
        // README create populator class for this behaviour
        filters.forEach(f -> routes.forEach(r -> r.filter(f)));
        beforeFilters.forEach(f -> routes.forEach(r -> r.before(f)));
        afterFilters.forEach(f -> routes.forEach(r -> r.after(f)));
        
        return routes.stream().map(Route.Builder::build).collect(Collectors.toList());
    }
656971
public ProteusApplication addDefaultRoutes(RoutingHandler router)
    {

        if (config.hasPath("health.statusPath")) {
            try {
                final String statusPath = config.getString("health.statusPath");

                router.add(Methods.GET, statusPath, (final HttpServerExchange exchange) ->
                {
                    exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, MediaType.TEXT_PLAIN);
                    exchange.getResponseSender().send("OK");
                });

                this.registeredEndpoints.add(EndpointInfo.builder().withConsumes("*/*").withProduces("text/plain").withPathTemplate(statusPath).withControllerName("Internal").withMethod(Methods.GET).build());

            } catch (Exception e) {
                log.error("Error adding health status route.", e.getMessage());
            }
        }

        if (config.hasPath("application.favicon")) {
            try {

                final ByteBuffer faviconImageBuffer;

                final File faviconFile = new File(config.getString("application.favicon"));

                if (!faviconFile.exists()) {
                    try (final InputStream stream = this.getClass().getResourceAsStream(config.getString("application.favicon"))) {
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();

                        byte[] buffer = new byte[4096];
                        int read = 0;
                        while (read != -1) {
                            read = stream.read(buffer);
                            if (read > 0) {
                                baos.write(buffer, 0, read);
                            }
                        }

                        faviconImageBuffer = ByteBuffer.wrap(baos.toByteArray());
                    }

                } else {
                    try (final InputStream stream = Files.newInputStream(Paths.get(config.getString("application.favicon")))) {
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();

                        byte[] buffer = new byte[4096];
                        int read = 0;
                        while (read != -1) {
                            read = stream.read(buffer);
                            if (read > 0) {
                                baos.write(buffer, 0, read);
                            }
                        }

                        faviconImageBuffer = ByteBuffer.wrap(baos.toByteArray());
                    }
                }

                router.add(Methods.GET, "favicon.ico", (final HttpServerExchange exchange) ->
                {
                    exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, io.sinistral.proteus.server.MediaType.IMAGE_X_ICON.toString());
                    exchange.getResponseSender().send(faviconImageBuffer);
                });

            } catch (Exception e) {
                log.error("Error adding favicon route.", e.getMessage());
            }
        }

        return this;
    }
532672
def get_urls(self):
        
        ret = super(SimpleRouter, self).get_urls()
        for router in self.nested_routers:
            ret.extend(router.get_urls())
        return ret
263975
public static Router createRouterFor(ServletContext con) {
        String contextName = EldaRouterRestletSupport.flatContextPath(con.getContextPath());
        List<PrefixAndFilename> pfs = prefixAndFilenames(con, contextName);
        //
        Router result = new DefaultRouter();
        String baseFilePath = ServletUtils.withTrailingSlash(con.getRealPath("/"));
        AuthMap am = AuthMap.loadAuthMap(EldaFileManager.get(), noNamesAndValues);
        ModelLoader modelLoader = new APIModelLoader(baseFilePath);
        addBaseFilepath(baseFilePath);
        //
        SpecManagerImpl sm = new SpecManagerImpl(result, modelLoader);
        SpecManagerFactory.set(sm);
        //
        for (PrefixAndFilename pf : pfs) {
            loadOneConfigFile(result, am, modelLoader, pf.prefixPath, pf.fileName);
        }
        int count = result.countTemplates();
        return count == 0 ? RouterFactory.getDefaultRouter() : result;
    }