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

Source

This addModule(Type moduleType)

Adds a module to the registry. Any modules defined with the @SubModule facet are also added.

addModules

Source

This addModules(Type[] moduleTypes)

Adds many modules to the registry

addModulesFromIndexProperties

Source

This addModulesFromIndexProperties()

Looks for all index properties of key afIoc.module which defines a qualified name of a module to load.

addModulesFromPod

Source

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 is true then the pod's dependencies are also inspected for IoC modules.

build

Source

Registry build()

Constructs and returns the registry; this may only be done once. The caller is responsible for invoking Registry.startup.

get

Source

@Operator
Obj? get(Str name)

Returns a value from the options map.

moduleTypes

Source

Type[] moduleTypes()

Returns a list of modules types currently held by this builder.

options

Source

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

Source

@Operator
This set(Str name, Obj? value)

Sets a value in the options map. Returns this so it may be used as a builder method..