This a project that can help you build your manager.
Especially for class that need to be controlled under different packages.
Like the Test(module).
package-a
CollectionA.java
package-b
CollectionB.java
CollectionC.java
CollectionIface.java
CollectionManager.java
Sometimes we want to holder all collection in CollectionManager.class,
but Collection in different package.
If in same package,we can use java reflect to load them.
In different package,now you can do like this.
Add CollectionRegister annotation to the class.
@CollectionRegister(type = "c",target = CollectionIface.class)
public class CollectionC implements CollectionIface {
@Override
public void inject(Object[] args) {
}
}
Add Collector annotation to the manager field.
@Collector(CollectionIface.class)
Map<String,CollectionIface> collections = new HashMap<>(16);
When the (Manager)Class be initialed,do like this:
AutoCollect.begin(new CollectionManager());
And then, you can use you Manager like used to.
public interface CollectionIface extends InjectIface {
}
The super class extend/implements InjectIface,witch provider an common method
public void inject(Object[] args) {
}
but now this method has to call by yourself. In the next version we may call inject when it has been processored.