commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32642] New: - Copy Specific Properties
Date Fri, 10 Dec 2004 20:25:59 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32642>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32642

           Summary: Copy Specific Properties
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: drdevlin@bellsouth.net


In building an application my team came across a need to copy specific 
properties only.  I realize this is a trivial enhancement however it would 
save others who find the same need from coding a solution themselves.

Below is an implementation ( The one we used ).

------------Code-------------
public static void copyProperties(Object to, Object from, String[] properties) 
throws IllegalAccessException, 
       InvocationTargetException,
       NoSuchMethodException {
    for (int idx = 0; idx < properties.length; idx++) {
	copyProperty( to, 
                      propertyNames[i], 
                      getPropertyUtils().getProperty( from, propertyNames[i]));
    }
}
-------------Code---------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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