public abstract class RouteHandler<T extends Context> extends PathHandler<T>
路由处理器
Route
| 限定符和类型 | 字段和说明 |
|---|---|
Set<String> |
consume
支持接收的Content-Type
|
Set<String> |
method
支持的方法
|
Set<String> |
produce
支持响应的Content-Type
|
path, pieces, protocol| 构造器和说明 |
|---|
RouteHandler(String path)
创建
RouteHandler |
RouteHandler(String protocol,
String path)
创建
RouteHandler |
RouteHandler(String protocol,
String path,
Set<String> method,
Set<String> consume,
Set<String> produce)
创建
RouteHandler |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(PathHandler<T> other) |
protected boolean |
consumeMatch(T ctx)
支持接收的Content-Type匹配
|
int |
match(T ctx)
匹配
|
protected boolean |
methodMatch(T ctx)
方法匹配
|
protected boolean |
produceMatch(T ctx)
支持响应的Content-Type匹配
|
String |
toString() |
doCompare, pathMatchpublic RouteHandler(String path)
RouteHandlerpath - PathHandler.pathpublic RouteHandler(String protocol, String path)
RouteHandlerprotocol - PathHandler.protocolpath - PathHandler.pathpublic RouteHandler(String protocol, String path, Set<String> method, Set<String> consume, Set<String> produce)
RouteHandlerprotocol - PathHandler.protocolpath - PathHandler.pathmethod - methodconsume - consumeproduce - producepublic int compareTo(PathHandler<T> other)
compareTo 在接口中 Comparable<PathHandler<T extends Context>>compareTo 在类中 PathHandler<T extends Context>protected boolean methodMatch(T ctx)
protected boolean consumeMatch(T ctx)
protected boolean produceMatch(T ctx)
public String toString()
toString 在类中 PathHandler<T extends Context>Copyright © 2023. All rights reserved.