Alias canFactoryGenericFactory
Checks if a structure has factory method for GenericFactory.
template canFactoryGenericFactory(T, Z)
;
This static interface is used by annotation system to identify annotations that mark an object as instantiable by container. The @component annotation is such a structure that implements this static interface and therefore it is possible to use it to mark components instantiable. A "@component" annotation must have a factory method that returns a GenericFactory instance that further will be used to configure an instantiable object. In such a way it is possbile to define other custom annotations that return GenericFactory implementations that add/or behave differrently comparing to default implementation of GenericFactory.
Alias canFactoryGenericFactory
Template canFactoryGenericFactory
Examples
struct Component {
GenericFactory!T factory(T)(Locator!() locator) {
return new GenericFactoryImpl!(T)(locator);
}
}
Parameters
Name | Description |
---|---|
T | the structure to be tested for interface compatibility |
Z | the type of object that T has to instantiate |
Returns
true in case of structure implementing static interface, false otherwise.