protected String getConfigInfo()

in core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/AbstractStartupObserver.java [47:98]


    protected String getConfigInfo(CodiConfig config)
    {
        StringBuilder info = new StringBuilder();

        List<String> methodNames = new ArrayList<String>();

        Class currentClass = ProxyUtils.getUnproxiedClass(config.getClass());
        while (currentClass != null &&
                !Object.class.getName().equals(currentClass.getName()) &&
                !AbstractAttributeAware.class.getName().equals(currentClass.getName()))
        {

            info.append("config implementation: ");
            info.append(currentClass.getName());
            info.append(separator);

            //inspect the other methods of the implementing class
            for(Method currentMethod : currentClass.getDeclaredMethods())
            {
                if(!currentMethod.isAnnotationPresent(ConfigEntry.class) ||
                        methodNames.contains(currentMethod.getName()))
                {
                    continue;
                }

                methodNames.add(currentMethod.getName());

                info.append("   method:\t").append(currentMethod.getName());
                info.append(separator);
                Object value;
                try
                {
                    value = currentMethod.invoke(config);
                    info.append("   value:\t").append(value.toString());
                }
                catch (IllegalAccessException e)
                {
                    info.append("   value:\t[unknown]");
                }
                catch (InvocationTargetException e)
                {
                    info.append("   value: [unknown]");
                }
                info.append(separator);
                info.append(separator);
            }

            currentClass = currentClass.getSuperclass();
        }

        return info.toString();
    }