Given a class :
public ClassA {
@Autowired
@SomeAnnotation("foo")
private ClassB bar;
}
@Component
@Scope(prototype)
public ClassB {
private String someString;
}
I would like to write some bean processor (post construct…) that can at ClassB construction time can access the @SomeAnnotation on the intances that ClassB is getting injected into so that I can set the value of someString to “foo”.
I know this isn’t very IoC and I’m going to guess it cannot be done.
You might be able to do something like this with a
@PostConstructofClassA:Update: – General solution using a BeanPostProcessor :