Let's imagine, there are 1000 classes (X1...X1000) which are all defined in a library abc.jar.
The X* classes have used some JSR-330 annotations, like:
class X12 { @Inject Foo foo; @Inject Bar bar; } My main class is a test case @RunWith(SpringJUnit4ClassRunner.class), and the referenced Foo, Bar are well defined in the bean XML files.
The question is, I don't want to define X1...X1000 in any XML files. But I'd like to auto wire them, for example:
X173 x173 = new X173(); But the problem is, using Java new instance, foo/bar isn't wired.
This also not works:
X173 x173 = applicationContext.getBean(X173.class); because no bean for X173 is defined.
And, X173 may also contains a member of class X258 which should be wired, too. I can't figure out how to implement it until I've resolved this question.