AcRegister(…) |
Declares a class factory. Optional arguments can be used to further configure it. |
AcInitializer(selector, …) |
Specifies an initializer to be used when instantiating a class. Option arguments specify where to get the values from for any initializer arguments. |
AcMethod(return-type, selector, …) |
Registers a method as an object factory. If the method is an instance method, then Alchemic will make sure the class is instantiated first. If the method is a class method then it is called directly. Also takes the same configuration arguments as AcRegister . Optional arguments specify where to get the values from for any method arguments. |
AcInject(variable, …) |
Declares an injection. If no arguments are specified, Alchemic will interrogate the runtime for the variables type data and build some model search criteria based on that. |
AcFactoryName(name) |
Configuration option for AcRegister and AcMethod tags. Specifies a custom name to store the object factory under in the model. |
AcTemplate |
Configuration option for AcRegister and AcMethod tags. Indicates that the object factory is to behave like a template, creating new instances of the class every time an object is requested. AcSet cannot be used with a template because the object factory will never store a value. |
AcPrimary |
Configuration option for AcRegister and AcMethod tags. Indicates that the object factory is considered more important that other object factories when considering possible candidates for injection. If primary object factories are returned in a model search, all other object factories will be ignored. |
AcReference |
Configuration option for AcRegister and AcMethod tags. Puts the object factory into reference mode. In this mode the object factory will not generate any objects. Instead it will wait to be given an object to be stored for injection. Attempting to inject an object from a reference object factory which no value has been stored will throw an exception unless the factory is also configured with the AcNillable option. |
AcNillable |
Configuaration option for AcRegister and AcMethod tags. Indicates that the object factory is allowed to have a nil value. This is often teamed with the AcWeak tag. |
AcWeak |
Configuration option for AcRegister and AcMethod tags. Weak object factories store weak references to the objects they have created or stored. This stops the object factory from creating memory leaks when dealing with objects (such as UIViewController instances) which are not always present. |
AcTransient |
Configuration option for AcInject . Specifies that the variable injection is regarded as transient. Effectively this means that Alchemic will watch the object factories that supplied objects for the injection and if any change their stored references, Alchemic will re-inject the dependency automatically. |
AcArg(arg-type, …) |
Used to declare arguments for AcInitializer and AcMethod tags. The arg type is the expected type of the method argument. Optional arguments can then be added to define where the value for the argument comes from. AcArg is most useful where the search criteria for a value is a different type to the argument. |
AcGet(return-type, …) |
Can be used inline with your code to retrieve a value from Alchemic. The retunr type is the type that Alchemic is expected to return. This will be used for any autoboxing required. If there are no search criteria after the return type, then it will be examined to deduce a matching search criteria. |
AcSet(value, …) |
Can be used inline with your code to set a value in an Alchemic object factory. After the value to be set, you can specify search criteria to be used to find the obejct factory to be set. If not specified the type of the value will be used as a search critieria. |
AcClass(class-name) |
Used when you need to search for one or more object factories in the model. Searches the model for object factories that manage objects of the specified class. There can only be a single instance of AcClass in any search criteria. |
AcProtocol(protocol-name) |
Used when you need to search for one or more object factories in the model. Searches the model for object factories that manage objects which conform to the specified protocol. You can used as many of these as you see fit in a search criteria. |
AcName(object-factory-name) |
Used when you need to search for one or more object factories in the model. USed when you know the name of the object factory you want to retrieve. Cannot be used with AcClass and AcProtocol. |