if (StringUtils.isBlank(command)) {
logTailorXMLInvalid("found <config> without command attribute");
return null;
}
final CommandConfiguration newCmdConfig = new CommandConfiguration();
newCmdConfig.setCommandName(command);
final List<Element> elActions = XmlUtils.findElements("action",
elConfig);
for (final Element elAction : elActions) {
// Determine the action type
if (StringUtils.isBlank(elAction.getAttribute("type"))) {
logTailorXMLInvalid("found <action> without type attribute");
return null;
}
final ActionConfig newAction = new ActionConfig(
elAction.getAttribute("type"));
final NamedNodeMap attributes = elAction.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
final Node item = attributes.item(i);
final String attributeKey = item.getNodeName();
if (!"type".equals(attributeKey)) {
newAction.setAttribute(attributeKey,
item.getNodeValue());
}
}
newCmdConfig.addAction(newAction);
}
result.addCommandConfig(newCmdConfig);
}
return result;