From 92db3c04053b2d92032e3ef89167011cc7191d26 Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Sun, 12 Oct 2014 17:41:09 +0200 Subject: [PATCH] Add "Autowired" alias for "Autowire" UDA to satisfy Spring habits --- source/poodinis/autowire.d | 2 ++ test/poodinis/autowiretest.d | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index c6c7efd..2f99ab9 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -18,6 +18,8 @@ debug { class Autowire{}; +alias Autowired = Autowire; + public void autowire(Type)(Container container, Type instance) { foreach (member ; __traits(allMembers, Type)) { static if(__traits(compiles, __traits( getMember, Type, member )) && __traits(compiles, __traits(getAttributes, __traits(getMember, Type, member )))) { diff --git a/test/poodinis/autowiretest.d b/test/poodinis/autowiretest.d index 4b6497c..aac24e8 100644 --- a/test/poodinis/autowiretest.d +++ b/test/poodinis/autowiretest.d @@ -43,7 +43,7 @@ version(unittest) { } class ComponentF { - @Autowire + @Autowired public ComponentA componentA; mixin AutowireConstructor;