PodSpec<T> constructor
PodSpec<T> (
- SpecContext _context
A concrete implementation of the `Spec` API in Jetleaf.
PodSpec provides the internal mechanism for building, configuring,
and cloning pod definitions that are registered into the container.
While developers usually interact with the higher-level `Spec` API
when customizing pods, Jetleaf internally uses PodSpec to hold
the actual configuration state.
Key Details
- Backed by a
`RootPodDefinition`that stores all pod metadata. - All configuration methods from
`Spec`delegate into this root definition. - Ensures that pods are fully validated before cloning into the registry.
Example
Developers typically don’t instantiate PodSpec directly, but interact with it
through the registerPod API:
registry.registerPod(MyService.classType, customizer: (spec) {
spec
.namedAs('myService')
.withScope(ScopeType.singleton)
.describedAs('Provides the MyService business logic')
.suppliedBy((ctx) => MyService());
});
Implementation
PodSpec(this._context) : _root = RootPodDefinition(type: NullablePod.CLASS), super(type: NullablePod.CLASS);