public class PathTrie extends Object
Constructor and Description |
---|
PathTrie()
构造
|
Modifier and Type | Method and Description |
---|---|
void |
add(String path,
HttpHandler handler)
添加路由
|
HttpHandler |
match(String path)
查找匹配的处理器,采用最长匹配模式,即:
传入"a/b/c",存在"a/b/c",则直接匹配,否则匹配"a/b",否则匹配"a" |
public void add(String path, HttpHandler handler)
path
- 路径handler
- 处理器public HttpHandler match(String path)
path
- 路径Copyright © 2025. All rights reserved.