use of org.jboss.galleon.config.ConfigItem in project galleon by wildfly.
the class FeatureGroupXmlWriter method writeFeatureGroupSpecBody.
static void writeFeatureGroupSpecBody(final ElementNode configE, ConfigItemContainer featureGroup, String ns) {
if (!featureGroup.hasItems()) {
return;
}
String currentOrigin = null;
ElementNode parent = configE;
for (ConfigItem item : featureGroup.getItems()) {
final String itemOrigin = item.getOrigin();
if (itemOrigin != null) {
if (!itemOrigin.equals(currentOrigin)) {
parent = addElement(configE, Element.ORIGIN.getLocalName(), ns);
addAttribute(parent, Attribute.NAME, itemOrigin);
currentOrigin = itemOrigin;
}
} else if (currentOrigin != null) {
currentOrigin = null;
parent = configE;
}
if (item.isGroup()) {
writeFeatureGroupDependency(parent, (FeatureGroup) item, ns);
} else {
addFeatureConfig(parent, (FeatureConfig) item, ns);
}
}
}
Aggregations