mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 12:14:01 +01:00
Add "Autowired" alias for "Autowire" UDA to satisfy Spring habits
This commit is contained in:
parent
b0c880a950
commit
92db3c0405
|
@ -18,6 +18,8 @@ debug {
|
||||||
|
|
||||||
class Autowire{};
|
class Autowire{};
|
||||||
|
|
||||||
|
alias Autowired = Autowire;
|
||||||
|
|
||||||
public void autowire(Type)(Container container, Type instance) {
|
public void autowire(Type)(Container container, Type instance) {
|
||||||
foreach (member ; __traits(allMembers, Type)) {
|
foreach (member ; __traits(allMembers, Type)) {
|
||||||
static if(__traits(compiles, __traits( getMember, Type, member )) && __traits(compiles, __traits(getAttributes, __traits(getMember, Type, member )))) {
|
static if(__traits(compiles, __traits( getMember, Type, member )) && __traits(compiles, __traits(getAttributes, __traits(getMember, Type, member )))) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ version(unittest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ComponentF {
|
class ComponentF {
|
||||||
@Autowire
|
@Autowired
|
||||||
public ComponentA componentA;
|
public ComponentA componentA;
|
||||||
|
|
||||||
mixin AutowireConstructor;
|
mixin AutowireConstructor;
|
||||||
|
|
Loading…
Reference in a new issue