CallbackConfigurer

Configures/modifies component of type T with help of a delegate or function.

Encapsulates component configuration logic using a delegate. The algorithm calls delegate, with a locator, a set of Args, and configured component, in order to modify the component.

Note: If component is not a reference type it is recommended to pass it by ref in order to avoid receiving of a copy and not original one in delegate. It is expected that the callback will use somehow method on which it was annotated with.

@safe
class CallbackConfigurer : PropertyConfigurer!T(
T
X
Dg
Args...
) if (
is(T : X) &&
(
is(Dg : void delegate
(
Locator!()
,
X
,
Args
)
) ||
is(Dg : void function
(
Locator!()
,
X
,
Args
)
)
||
is(Dg : void delegate
(
Locator!()
,
ref X
,
Args
)
)
||
is(Dg : void function
(
Locator!()
,
ref X
,
Args
)
)
)
) {}

Constructors

this
this(Dg dg, Args args)

Constructor for CallbackConfigurer!(T, Dg, Args)

Members

Functions

configure
void configure(T object)

Accepts a reference to an object that is to be configured by the configurer.

Mixins

__anonymous
mixin LocatorAwareMixin!(typeof(this))
Undocumented in source.
__anonymous
mixin ParameterHolder!Args
Undocumented in source.

Parameters

T

the component

Args

type tuple of arguments used by delegate for customization.

Meta