canFactoryGenericFactory

Checks if a structure has factory method for GenericFactory.

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.

  1. template canFactoryGenericFactory(alias T, Z)
    template canFactoryGenericFactory (
    Z
    ) if (
    !isTemplate!T
    ) {}
  2. template canFactoryGenericFactory(T, Z)

Members

Aliases

canFactoryGenericFactory
alias canFactoryGenericFactory = canFactoryGenericFactory!(typeof(T), Z)
Undocumented in source.

Parameters

T

the structure to be tested for interface compatibility

Z

the type of object that T has to instantiate

Return Value

true in case of structure implementing static interface, false otherwise.

Examples

struct Component {
    GenericFactory!T factory(T)(Locator!() locator) {
        return new GenericFactoryImpl!(T)(locator);
    }
}

Meta