For a client I had to implement spring based startup module. The module's context xml file simply defines annotation-config and component-scan element and doesn't define any bean. When I add 50-th bean into the module, I reliazed I can't manage dependencies without painting them anymore.

 

The fast search had lead to 3 nice tools: SpringSource Tool Suite, BeanDoc and Maia EAP. Each one of them may analyze dependencies and may paint them. But no one of them may deal with annotations.

 

Annotated Bean(s) Dependency Analyzer scans folders and paints dependencies of every discovered spring bean. Behind the scene, the spring is doing the hard work.

public class ContextProcessor {
    private final HashMap<String, Bean> beanMap;
    private final ClassPathBeanDefinitionScanner scanner;

    public ContextProcessor() {
        beanMap = new HashMap<String, Bean>();
        scanner = new ClassPathBeanDefinitionScanner(
new AnnotationConfigApplicationContext());
    }

    public void process(String ... basePackages)
throws Exception{
        scanner.scan(basePackages);

...

}

 

For the source code, please see http://git.tikalk.com/a-bean-soup project page at Tikal Git space.