}
return propertyMapping;
}
private void mapProperty(Map<Method, Object> propertyMapping, Properties properties, String path, Method method) throws ConfigurationException {
Property property = defendMethod(method);
String separator = path.equals("") ? "" : ".";
String propertyPath = path + separator + property.id();
String value = properties.getProperty(propertyPath);
logger.debug(Messages.getString("try.to.map.and.coerce.property.pstr"), propertyPath);
Object nested = checkNested(properties, method.getReturnType(), propertyPath);
if (nested != null) {
propertyMapping.put(method, nested);
} else if (value != null) {
propertyMapping.put(method, getCoercer().coerce(value, method.getReturnType()));
} else if (property.optional()) {
propertyMapping.put(method, getCoercer().coerce(property.value(), method.getReturnType()));
} else {
throw new ConfigurationException(Messages.getString("required.property.0.is.missing", propertyPath));
}
}