I am using the below code to get all the beans in the application.
Map<String, MyBuilder> allBuilders = context.getBeansOfType(MyBuilder.class);
After getting each beans, how do I get the class to which that particular bean is avalibale?
For example, considering the below code:
@MyAnnotation(name = "one")
public class MyService{
@Dummy(description = "test")
public MyBuilder builder1() {
return someValue;
}
}
Using getBeansOfType() method gives the "builder1" bean of type "getBeansOfType". But how do I get the actual super class in which this bean is available?
For the provided example, I want the class MyService and it's annotations to be the output.
Ideally, I want to get all the below information from the above code.
- MyAnnotation Parameter (name = "one") from MyService class
- Dummy Parameter ( description = "test")
- MyBuilder bean object