Search in sources :

Example 1 with PowerMockInternalException

use of org.powermock.PowerMockInternalException in project powermock by powermock.

the class ConfigurationMapper method map.

public void map(final Properties properties) {
    try {
        BeanInfo info = Introspector.getBeanInfo(configurationClass, Object.class);
        PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
        for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
            if (propertyDescriptor.getWriteMethod() != null) {
                mapProperty(propertyDescriptor, properties);
            }
        }
    } catch (Exception e) {
        throw new PowerMockInternalException(e);
    }
}
Also used : PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) PowerMockInternalException(org.powermock.PowerMockInternalException) PowerMockInternalException(org.powermock.PowerMockInternalException)

Aggregations

BeanInfo (java.beans.BeanInfo)1 PropertyDescriptor (java.beans.PropertyDescriptor)1 PowerMockInternalException (org.powermock.PowerMockInternalException)1