DefaultRouter class

The default implementation of Router.

Implemented types

Constructors

DefaultRouter({Map<Pattern, dynamic>? uriMapping, Map<int, dynamic>? errorMapping, Map<String, RequestFilter>? filterMapping, int cacheSize = 1000, bool protectRSP = true})
The constructor.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

filter(Pattern uri, RequestFilter filter, {bool preceding = false}) → void
Maps the given URI to the given filter. *
override
getErrorHandler(Object? error) Object?
Returns the error handler (RequestHandler) or a URI (String) based on the error thrown by a request handler.
override
getFilterAt(int iFilter) RequestFilter
Returns the filter at the given index.
override
getFilterIndex(HttpConnect connect, String uri, int iFilter) int?
Returns the index of the next matched request filter for the given URI and starting at the given index.
override
getHandler(HttpConnect connect, String uri) Object?
Retrieves the first matched request handler (RequestHandler) or forwarded URI (String) for the given URI.
override
map(Pattern uri, Object? handler, {bool preceding = false}) → void
Maps the given URI to the given handler.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shallCache(HttpConnect connect, String uri) bool
Retursn whether the mapping of the given uri shall be cached.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getNamedGroup(HttpConnect connect, String name) String?
Retrieves the named capturing group of the given name, specified in map's uri, or null if not found.