}
void reflectAndInvokeAttribute(AbstractConfigurationBean bean, Method m, Element node) {
Class<?> parameterType = m.getParameterTypes()[0];
// is there a ConfigurationAttribute matching the current node iterated?
ConfigurationAttribute a = m.getAnnotation(ConfigurationAttribute.class);
boolean matchedAttributeToSetter = a != null && a.containingElement().equals(node.getNodeName());
boolean isConfigBean = AbstractConfigurationBean.class.isAssignableFrom(parameterType);
if (matchedAttributeToSetter) {
String attValue = getAttributeValue(node, a.name());
Object methodAttributeValue = null;
if (attValue != null && attValue.length() > 0) {
PropertyEditor editor = PropertyEditorManager.findEditor(parameterType);
if (editor == null) {
throw new ConfigurationException("Could not find property editor, type="
+ parameterType + ",method=" + m + ",attribute=" + a.name());
}
editor.setAsText(attValue);
methodAttributeValue = editor.getValue();
} else if (a.defaultValue().length() > 0) {
methodAttributeValue = a.defaultValue();
}
if (methodAttributeValue != null) {
try {
m.invoke(bean, methodAttributeValue);
} catch (Exception ae) {
throw new ConfigurationException("Illegal attribute value " + attValue + ",type="
+ parameterType + ",method=" + m + ",attribute=" + a.name(), ae);
}
}
} else if (isConfigBean) {
AbstractConfigurationBean childBean = findAndInstantiateBean(node);
boolean foundMatchingChild = childBean != null