AbstractHandlerMapping class abstract

Base class for JetLeaf handler mappings that associate request paths with handler methods.

Subclasses of AbstractHandlerMapping implement the core logic for resolving which HandlerMethod should handle a given request path. This class provides utilities for path pattern parsing, context path retrieval, and handler registration.

Responsibilities

  • Hold a reference to the PathPatternParserManager for path parsing.
  • Provide context path information for global route resolution.
  • Offer a protected method to register handlers against path patterns.
  • Support extensibility for custom handler resolution strategies.

Example

final class MyHandlerMapping extends AbstractHandlerMapping {
  MyHandlerMapping(PathPatternParserManager parser) : super(parser);

  @override
  String getContextPath() => "/";

  void initialize() {
    registerHandler(PathPattern("/api/users/**"), userHandler);
  }
}
Implemented types
Implementers
Annotations
  • @Author.new("Evaristus Adimonyemma")

Constructors

AbstractHandlerMapping(PathPatternParserManager parser)
Creates a new AbstractHandlerMapping using the provided parser.

Properties

hashCode int
The hash code for this object.
no setterinherited
parser → PathPatternParserManager
The composite path matcher used to evaluate and normalize URL patterns.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getContextPath() String
Returns the global context path from the active Environment.
getHandler(ServerHttpRequest request) HandlerMethod?
Resolves a HandlerMethod capable of handling the given request.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerHandler(PathPattern pattern, HandlerMethod handler) → void
Registers a HandlerMethod for the given pattern.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited