You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2013/03/13 22:04:14 UTC

[jira] [Commented] (BEANUTILS-248) Code to create a JavaBean and set its properties from a Java Properties instance

    [ https://issues.apache.org/jira/browse/BEANUTILS-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13601633#comment-13601633 ] 

Benedikt Ritter commented on BEANUTILS-248:
-------------------------------------------

Now that we have switched to Java 5 we could even do something like:

{code}
public T populateNewInstance(Class<T> beanClass, Map<String, String> properties) { 
   T bean = beanClass.newInstance(); 
   populate(bean, properties); 
   return bean; 
}
{code}
                
> Code to create a JavaBean and set its properties from a Java Properties instance
> --------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-248
>                 URL: https://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: LATER THAN 1.8.4
>
>         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, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira