commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-248) Code to create a JavaBean and set its properties from a Java Properties instance
Date Wed, 15 Nov 2006 02:23:38 GMT
    [ http://issues.apache.org/jira/browse/BEANUTILS-248?page=comments#action_12449893 ] 
            
Henri Yandell commented on BEANUTILS-248:
-----------------------------------------

    public Object populateNewInstance(Class beanClass, Map properties) {
        Class beanClass = Class.forName(className);   // TODO: ContextClassLoader?
        Object bean = beanClass.newInstance();
        populate(bean, properties);
        return bean;
    }

> Code to create a JavaBean and set its properties from a Java Properties instance
> --------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-248
>                 URL: http://issues.apache.org/jira/browse/BEANUTILS-248
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: Coded on Windows XP professional with Netbean 5.5 Beta 2 using JDK
1.5.0
>            Reporter: Trevor Charles Miller
>            Priority: Minor
>             Fix For: 1.8.0
>
>         Attachments: BeanCreator.java
>
>
> The idea is simple and I've seen this done in Log4J and had a use case for it myself
in another project. Given a set of properties, create an instance of a specified class and
set properties on it. I think this could be very useful for runtime configuration.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message