Example usage for org.apache.commons.configuration.beanutils BeanDeclaration getBeanClassName

List of usage examples for org.apache.commons.configuration.beanutils BeanDeclaration getBeanClassName

Introduction

In this page you can find the example usage for org.apache.commons.configuration.beanutils BeanDeclaration getBeanClassName.

Prototype

String getBeanClassName();

Source Link

Document

Returns the name of the bean class, from which an instance is to be created.

Usage

From source file:nz.co.senanque.madura.spring.ConfigProxyFactoryBean.java

public Object getObject() throws Exception {
    Configuration config = m_configuration.getConfiguration();
    if (config instanceof XMLConfiguration) {
        BeanDeclaration decl = new XMLBeanDeclaration((XMLConfiguration) config, getKey());
        Object o = decl.getBeanClassName();
        if (o == null) {
            String value = config.getString(getKey());
            return value;
        }// w  ww.  j  a  v  a  2 s  .c  o m
        return BeanHelper.createBean(decl);
    } else {
        return config.getString(getKey());
    }
}

From source file:nz.co.senanque.madura.spring.ConfigProxyFactoryBean.java

public Class getObjectType() {
    if (m_configuration == null) {
        return null;
    }/*  www .j  av  a2s  . com*/
    Configuration config = m_configuration.getConfiguration();
    if (config instanceof XMLConfiguration) {
        try {
            BeanDeclaration decl = new XMLBeanDeclaration((XMLConfiguration) config, getKey());
            String n = decl.getBeanClassName();
            if (n == null) {
                return String.class;
            }
            return Class.forName(decl.getBeanClassName());
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    } else {
        return String.class;
    }
}