PodSpecContext class final
An implementation of `SpecContext` in Jetleaf that resolves
dependencies during pod creation and supplier evaluation.
PodSpecContext bridges the pod factory with pod specifications,
enabling suppliers and expressions to fetch other pods or objects.
Key Details
- Wraps a
`ListablePodFactory`for resolving pods. - Provides asynchronous resolution of both pods and objects.
- Used internally when evaluating
`Spec.suppliedBy`or dependency injection.
Example
registry.registerPod(MyService.classType, customizer: (spec) {
spec.suppliedBy((ctx) async {
final repo = await ctx.pod(Repository.classType);
return MyService(repo);
});
});
- Implemented types
Constructors
- PodSpecContext(ListablePodFactory _podFactory)
-
An implementation of
`SpecContext`in Jetleaf that resolves dependencies during pod creation and supplier evaluation.
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
-
get(
Class< Object> requiredType, {List<ArgumentValue> ? arguments}) → Future<Object> -
Resolves an object of the given
requiredTypefrom the context.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pod<
T> (Class< T> requiredType, {String? name, List<ArgumentValue> ? arguments}) → Future<T> -
Resolves a pod of type
Tfrom the context.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited