Skip to content

Commit

Permalink
Merge pull request #475 from jsight/rulefixes
Browse files Browse the repository at this point in the history
Fixed rules for Sonic ESB To have ids and fixed missing messages. Also, ...
  • Loading branch information
jsight committed Feb 18, 2015
2 parents ed1bad6 + c3d9840 commit 2bd0d48
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 59 deletions.
Expand Up @@ -4,6 +4,7 @@

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.jboss.windup.config.parser.ElementHandler;
import org.jboss.windup.config.parser.NamespaceElementHandler;
import org.jboss.windup.config.parser.ParserContext;
Expand All @@ -24,6 +25,8 @@ public Void processElement(ParserContext context, Element element)
ConfigurationRuleBuilder rule = (ConfigurationRuleBuilder) context.getBuilder().addRule();
context.setRule(rule);

String id = $(element).attr("id");

List<Element> children = $(element).children().get();
for (Element child : children)
{
Expand All @@ -47,6 +50,12 @@ public Void processElement(ParserContext context, Element element)
break;
}
}

if (StringUtils.isNotBlank(id))
{
rule.withId(id);
}

return null;
}

Expand Down

0 comments on commit 2bd0d48

Please sign in to comment.