Class WebHandlerMatcher

java.lang.Object
io.fluxcapacitor.javaclient.web.WebHandlerMatcher
All Implemented Interfaces:
HandlerMatcher<Object,DeserializingMessage>

public class WebHandlerMatcher extends Object implements HandlerMatcher<Object,DeserializingMessage>
Specialized HandlerMatcher that routes DeserializingMessages of type MessageType.WEBREQUEST to matching handler methods based on annotated URI patterns, HTTP methods, and optional origins.

This matcher is created internally by the HandlerFactory when registering a handler class that contains methods annotated for web request handling (e.g., @HandleWeb).

Routing Logic

The matcher builds a Router that maps:
  • HTTP method (e.g., GET, POST)
  • Normalized path (optionally prefixed by @Path at class or package level)
  • Optional request origin (e.g., scheme and host) when specified in the handler method
During matching, the DefaultWebRequestContext is used to extract the URI path, method, and origin from the incoming request metadata.

WebPattern Matching

Each handler method may be associated with one or more WebPatterns, derived from WebParameters annotations. These patterns define the matchable paths and methods.

Support for @Path Annotations

This matcher also respects @Path annotations on the method, declaring class, or package level, combining those with the WebPattern#getPath() when routing requests.

Fallback to ANY Method

If no handler matches the exact request method, but any handlers exist that declare HttpRequestMethod.ANY, these are checked as a fallback.
See Also: