SessionDriverRegistry class
Registry responsible for managing session driver registrations.
Third-party packages can use register and unregister to expose their own drivers at runtime. The class is a thin singleton wrapper around a map, deliberately avoiding any global state beyond the registry itself.
Properties
-
entries
→ Map<
String, SessionDriverRegistration> -
Provides direct access to the internal map of entries.
no setterinherited
-
entryNames
→ Iterable<
String> -
An iterable of all entry names in the registry.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
availableDrivers(
{Iterable< String> include = const []}) → List<String> -
Returns a sorted list of available driver names, ensuring that
includeis always present in the result. -
buildDocContext(
String driver, {required String pathBase}) → SessionDriverDocContext -
Builds a documentation context for
driverrooted atpathBase. -
builderFor(
String driver) → SessionDriverBuilder? -
Retrieves the builder associated with
driverornullwhen absent. -
clearEntries(
) → void -
Clears all entries from the registry.
inherited
-
contains(
String driver) → bool -
Returns
trueif a registration exists fordriver. -
containsEntry(
String name) → bool -
Checks if an entry with the given
nameexists in the registry.inherited -
createRegistration(
SessionDriverBuilder builder, {DriverDocBuilder< SessionDriverDocContext> ? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const []}) → SessionDriverRegistration -
Creates a registration object for the given driver
builder. -
documentation(
{required String pathBase}) → List< ConfigDocEntry> - Collates documentation from all registered drivers.
-
documentationFor(
String driver, {required String pathBase}) → List< ConfigDocEntry> -
Collects documentation for a single
driver, if provided.inherited -
driverNames(
{Iterable< String> include = const []}) → Iterable<String> -
Lists every driver name plus optional
includeidentifiers.inherited -
duplicateDiagnostics(
String name) → String -
Generates diagnostic information for duplicate entries with the given
name.inherited -
ensureRequirements(
String driver, SessionDriverBuilderContext context, SessionDriverRegistration registration) → void -
entryOrigin(
String name) → StackTrace? -
Retrieves the stack trace of the original registration for the given
name.inherited -
getEntry(
String name) → SessionDriverRegistration? -
Retrieves the entry associated with the given
name.inherited -
hasDriver(
String name) → bool -
Whether a driver named
nameexists in the registry.inherited -
normalizeName(
String name) → String -
Normalizes the given
nameby trimming and converting it to lowercase.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDuplicate(
String name, SessionDriverRegistration existing, bool overrideExisting) → bool -
Handles duplicate entries with the given
nameandexistingvalue. -
register(
String driver, SessionDriverBuilder builder, {SessionDriverDocBuilder? documentation, bool overrideExisting = true, SessionDriverValidator? validator, List< String> requiresConfig = const []}) → void -
Registers a new session
driver. -
registerDriver(
String name, SessionDriverBuilder builder, {DriverDocBuilder< SessionDriverDocContext> ? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const [], bool overrideExisting = true}) → bool -
Registers
builderundername, optionally attaching docs and validators.inherited -
registerDriverIfAbsent(
String name, SessionDriverBuilder builder, {DriverDocBuilder< SessionDriverDocContext> ? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const []}) → bool -
Registers
builderonly when no existing driver usesname.inherited -
registerEntry(
String name, SessionDriverRegistration value, {bool overrideExisting = true}) → bool -
Registers an entry with the given
nameandvalue.inherited -
registrationFor(
String name) → SessionDriverRegistration? -
Resolves the registration for
name, ornullwhen absent.inherited -
runValidator(
String driver, SessionDriverBuilderContext context, SessionDriverRegistration registration) → void -
toString(
) → String -
A string representation of this object.
inherited
-
unregister(
String driver) → void -
Removes the registration associated with
driverif it exists. -
unregisterDriver(
String name) → void -
Removes the driver registered under
name, if any.inherited -
unregisterEntry(
String name) → bool -
Unregisters the entry with the given
name.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → SessionDriverRegistry
-
Singleton accessor.
final