}
public static void setBeanProperties(Object bean, Properties props, String prefix) {
// Move all prop names to lower case so we can use reflection to get
// method names and look them up in the connection props.
final Properties connProps = lowerCaseAllPropNames(props);
final Method[] methods = bean.getClass().getMethods();
for (int i = 0; i < methods.length; i++) {
final Method method = methods[i];
final String methodName = method.getName();
// If setter ...
if ( methodName.startsWith("set") && method.getParameterTypes().length == 1 ) { //$NON-NLS-1$
// Get the property name
final String propertyName = methodName.substring(3); // remove the "set"
String shortName = propertyName.toLowerCase();
String propertyValue = null;
if (prefix != null) {
propertyValue = connProps.getProperty(prefix + "." + shortName); //$NON-NLS-1$
} else {
propertyValue = connProps.getProperty(shortName);
}
if (propertyValue == null) {
continue;
}
final Class<?> argType = method.getParameterTypes()[0];