Search in sources :

Example 1 with ConfigItem

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);
        }
    }
}
Also used : ConfigItem(org.jboss.galleon.config.ConfigItem) ElementNode(org.jboss.galleon.xml.util.ElementNode)

Aggregations

ConfigItem (org.jboss.galleon.config.ConfigItem)1 ElementNode (org.jboss.galleon.xml.util.ElementNode)1