java.lang.Object
dev.mccue.microhttp.handler.RouteHandler
- All Implemented Interfaces:
Handler
Template for a handler that handles a single route by matching
on the request's uri path and filtering on the request's method.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal IntoResponsehandle(org.microhttp.Request request) Handles the request.protected abstract IntoResponsehandleRoute(Matcher routeMatch, org.microhttp.Request request) static RouteHandlerstatic RouteHandlerof(String method, Pattern pattern, RouteHandler.MatcherHandler handler) static RouteHandlerof(String method, Pattern pattern, Callable<? extends IntoResponse> handler)
-
Constructor Details
-
RouteHandler
-
-
Method Details
-
handleRoute
protected abstract IntoResponse handleRoute(Matcher routeMatch, org.microhttp.Request request) throws Exception - Throws:
Exception
-
of
public static RouteHandler of(String method, Pattern pattern, Callable<? extends IntoResponse> handler) -
of
-
of
-
handle
Description copied from interface:HandlerHandles the request.If
nullis returned, that means that the handler is signaling that it does not want to handle theRequest. This would signal that anotherHandlershould be consulted or a default response should be used
-