classafIoc::OrderedConfig
sys::Obj afIoc::OrderedConfig
Passed into module contribution methods to allow the method to, err, contribute!
A service can collect contributions in three different ways:
- As an unordered list of values
- As an ordered list of values
- As a map of keys and values
The service defines the type of contribution by declaring a parameterised list or map in its ctor or builder method. Contributions must be compatible with the type.
- addOrdered
Void addOrdered(Str id, Obj object, Str[] constraints := Str[])Str#.emptyList()
Adds an ordered object to a service's contribution. Each object has a unique id (case insensitive) that is used by the constraints for ordering. Each constraint must start with the prefix
BEFORE:
orAFTER:
.config.addOrdered("Breakfast", eggs) config.addOrdered("Lunch", ham, ["AFTER: breakfast", "BEFORE: dinner"]) config.addOrdered("Dinner", pie)
Configuration contributions are ordered across modules.
- addUnordered
Adds an unordered object to a service's configuration.
- addUnorderedAll
Void addUnorderedAll(Obj[] objects)
Adds all the unordered objects to a service's configuration.
- autobuild
A helper method that instantiates an object, injecting any dependencies. See Registry.autobuild.
- toStr
virtual override Str toStr()