Search in sources :

Example 1 with PathTemplateMatcher

use of io.undertow.util.PathTemplateMatcher in project undertow by undertow-io.

the class RoutingHandler method addAll.

public synchronized RoutingHandler addAll(RoutingHandler routingHandler) {
    for (Entry<HttpString, PathTemplateMatcher<RoutingMatch>> entry : routingHandler.getMatches().entrySet()) {
        HttpString method = entry.getKey();
        PathTemplateMatcher<RoutingMatch> matcher = matches.get(method);
        if (matcher == null) {
            matches.put(method, matcher = new PathTemplateMatcher<>());
        }
        matcher.addAll(entry.getValue());
        // PathTemplates which we want to ignore here so it does not crash.
        for (PathTemplate template : entry.getValue().getPathTemplates()) {
            if (allMethodsMatcher.get(template.getTemplateString()) == null) {
                allMethodsMatcher.add(template, new RoutingMatch());
            }
        }
    }
    return this;
}
Also used : PathTemplateMatcher(io.undertow.util.PathTemplateMatcher) PathTemplate(io.undertow.util.PathTemplate) HttpString(io.undertow.util.HttpString)

Aggregations

HttpString (io.undertow.util.HttpString)1 PathTemplate (io.undertow.util.PathTemplate)1 PathTemplateMatcher (io.undertow.util.PathTemplateMatcher)1