classafIoc::RegistryBuilder
sys::Obj afIoc::RegistryBuilder
Use to create an IoC Registry. Modules may be added manually, defined by meta-data in dependent pods or defined by index properties
- addModule
This addModule(Type moduleType)
Adds a module to the registry. Any modules defined with the
@SubModule
facet are also added.- addModules
This addModules(Type[] moduleTypes)
Adds many modules to the registry
- addModulesFromIndexProperties
This addModulesFromIndexProperties()
Looks for all index properties of key
afIoc.module
which defines a qualified name of a module to load.- addModulesFromPod
This addModulesFromPod(Pod pod, Bool addDependencies := true)
Inspects the pod's meta-data for the key
afIoc.module
. This is then treated as a CSV list of (qualified) module type names to load.If
addDependencies
istrue
then the pod's dependencies are also inspected for IoC modules.- build
Registry build()
Constructs and returns the registry; this may only be done once. The caller is responsible for invoking Registry.startup.
- get
Returns a value from the
options
map.- moduleTypes
Type[] moduleTypes()
Returns a list of modules types currently held by this builder.
- options
Str:Obj? options { private set }
Use options to pass state into the IoC Registry. This map may be later retrieved from the RegistryMeta service.
- set
@
Operator
This set(Str name, Obj? value)Sets a value in the
options
map. Returnsthis
so it may be used as a builder method..