I'd like a way to mark certain classes as not needing injection (or at least
not needing Field injection or Member injection) to save some time in the
InjectionPoint#getInjectionPoints() method.
I would like to be able to annotate a class as follows:
@NoFieldInjection(lookInParents=false);
@NoMethodInjection(lookInParents=false);
class DoesntNeedInjection {
@Inject
public DoesntNeedInjection(SomeDependency dependency) {
}
}
@NoFieldInjection(lookInParents = true);
@NoMethodInjection(lookInParents = true);
class DoesntNeedInjection2 extends SomeParentClass {
//uses default constructor, and JIT binding
//this class has no fields/methods but the parent class does
}
-------
My reasoning is that for systems (i.e. RoboGuice) injection start up time takes
a non trivial amount of time and is done in the UI thread (separate issue, I
know, but I'd like to get better performance anyways).
With these marker attributes, we could save crawling the entire inheritance
tree, which could be large if you are using some type of 3rd party library.
Original issue reported on code.google.com by rich...@winograd.ca on 11 Oct 2012 at 5:34
Original issue reported on code.google.com by
rich...@winograd.ca
on 11 Oct 2012 at 5:34