1 package org
.argeo
.slc
.core
.execution
.doc
;
3 import org
.springframework
.beans
.MutablePropertyValues
;
4 import org
.springframework
.beans
.PropertyValue
;
5 import org
.springframework
.beans
.factory
.config
.BeanDefinition
;
6 import org
.springframework
.beans
.factory
.support
.BeanDefinitionRegistry
;
8 public class ConsoleContextDescriber
implements ContextDescriber
{
9 public void describeContext(BeanDefinitionRegistry registry
) {
10 String
[] beanNames
= registry
.getBeanDefinitionNames();
11 for (String beanName
: beanNames
) {
12 log("\n## BEAN: " + beanName
);
13 describeBean(registry
.getBeanDefinition(beanName
));
17 public void describeBean(BeanDefinition beanDefinition
) {
18 log("BeanDefinition class: "+beanDefinition
.getClass());
20 for(String attr
:beanDefinition
.attributeNames()){
21 log(attr
+"="+beanDefinition
.getAttribute(attr
));
24 MutablePropertyValues pValues
= beanDefinition
.getPropertyValues();
25 for (PropertyValue pv
: pValues
.getPropertyValues()) {
26 log(pv
.getName() + "= (" + pv
.getValue().getClass() + ") "
31 protected void log(Object obj
){
32 System
.out
.println(obj
);