Example library with Liberator
Here's example for usage:
- Create an interface:
publicinterfaceSomeMagic {
voidsend(Stringmsg);
}- Implement the interface and here should be used the @Service annotation:
@ServicepublicclassSomeMagicImplimplementsSomeMagic {
@Overridepublicvoidsend(Stringmsg) {
System.out.println(msg);
}
}- Inject with @AutoInject annotation:
//case 1: just one class implements interface@AutoInjectprivateSomeMagicmagic;
//case 2: more than one @AutoInject(SomeMagicImpl.class)
privateSomeMagicpureMagic;