Skip to content

Kitto.Web.Routing.Injection ​

Dependency injection registry for [TKXContext] parameters. Maps type info to provider functions that resolve values from the current activation context (session, config, request, etc.).

IKXActivationContext interface ​

Interface for the activation context, used by injection providers to access path parameters and other request state. Implemented by TKXActivation (Kitto.Web.Routing.Activation).

pascal
function GetPathParam(const AName: string): string;

Returns the captured value of the named path parameter ('' if absent).

TKXInjectionRegistry class ​

Singleton registry of injection providers, keyed by PTypeInfo. Providers are registered at startup and queried per-request during parameter filling. Extensible by applications.

pascal
constructor Create;

Creates the registry with an empty provider map.

pascal
destructor Destroy;

Frees the provider map.

pascal
class destructor DestroyClass;

Frees the singleton instance at unit finalization.

pascal
procedure RegisterProvider(const ATypeInfo: PTypeInfo;

Registers a provider for a specific type. If a provider for the same type already exists, it is replaced (allowing overrides).

pascal
function Resolve(const AType: TRttiType;

Resolves a value for the given RTTI type using the registered provider. Returns TValue.Empty if no provider is registered for the type.

Released under Apache License, Version 2.0.