This framework is inspired from Spring core framework https://github.com/spring-projects/spring-framework and uses Java Reflection API.
work in progress!
API may change in future.
What is working?
- Creating instance via Injector#inject('id'), fully qualified class name must be present in config file
Injector injector = new DepInjector("resources/config.xml");
MyClass instance= (MyClass)injector.inject("myclass");
- Creating instance by using @Instance Annotation and getting the object via Injector#inject('id'), here id must be equal to ClassName (case sensitve), assigning short id is work in progress
AnnotedClass inst = (AnnotedClass)injector.inject("AnnotedClass");
- Object instantiation via Annotation
To be done.
- getting instance by passing class type to inject method to remove parsing step.(not a priority currently)
P.S. Pull request is appreciated