throw new ConfigurationException("Couldn't find a setter named [" + setter + "] which takes a single parameter, for parameter " + propName + " on class [" + objectClass + "]");
}
}
public static Properties extractProperties(Element source) {
TypedProperties p = new TypedProperties();
NodeList list = source.getElementsByTagName("property");
if (list == null) return null;
// loop through attributes
for (int loop = 0; loop < list.getLength(); loop++) {
Node node = list.item(loop);
if (node.getNodeType() != Node.ELEMENT_NODE) continue;
// for each element (attribute) ...
Element element = (Element) node;
String name = element.getAttribute("name");
String valueStr = element.getAttribute("value");
if (valueStr.length() > 0) {
valueStr = valueStr.trim();
valueStr = StringPropertyReplacer.replaceProperties(valueStr);
p.put(name, valueStr);
}
}
return p.isEmpty() ? null : p;
}