Search in sources :

Example 26 with ElementNode

use of org.jboss.galleon.xml.util.ElementNode in project galleon by wildfly.

the class PackageXmlWriter method writePackageDependency.

private static void writePackageDependency(ElementNode deps, PackageDependencySpec depSpec, String ns) {
    final ElementNode depElement = addElement(deps, PackageDepsSpecXmlParser.PACKAGE, ns);
    addAttribute(depElement, Attribute.NAME, depSpec.getName());
    if (depSpec.isOptional()) {
        if (depSpec.isPassive()) {
            addAttribute(depElement, PackageDepsSpecXmlParser.Attribute.PASSIVE, TRUE);
        } else {
            addAttribute(depElement, PackageDepsSpecXmlParser.Attribute.OPTIONAL, TRUE);
        }
    }
}
Also used : ElementNode(org.jboss.galleon.xml.util.ElementNode)

Example 27 with ElementNode

use of org.jboss.galleon.xml.util.ElementNode in project galleon by wildfly.

the class ProvisioningXmlWriter method writeUniverseSpecs.

static void writeUniverseSpecs(FeaturePackDepsConfig fpDeps, final ElementNode parent) {
    ElementNode universesEl = null;
    UniverseSpec universeSpec = fpDeps.getDefaultUniverse();
    if (universeSpec != null) {
        universesEl = addElement(parent, Element.UNIVERSES.getLocalName(), parent.getNamespace());
        writeUniverseConfig(universesEl, null, universeSpec.getFactory(), universeSpec.getLocation());
    }
    if (fpDeps.hasUniverseNamedSpecs()) {
        if (universesEl == null) {
            universesEl = addElement(parent, Element.UNIVERSES.getLocalName(), parent.getNamespace());
        }
        for (Map.Entry<String, UniverseSpec> universe : fpDeps.getUniverseNamedSpecs().entrySet()) {
            writeUniverseConfig(universesEl, universe.getKey(), universe.getValue().getFactory(), universe.getValue().getLocation());
        }
    }
}
Also used : ElementNode(org.jboss.galleon.xml.util.ElementNode) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Map(java.util.Map)

Aggregations

ElementNode (org.jboss.galleon.xml.util.ElementNode)27 Map (java.util.Map)8 TextNode (org.jboss.galleon.xml.util.TextNode)4 XMLStreamException (javax.xml.stream.XMLStreamException)3 ConfigId (org.jboss.galleon.config.ConfigId)3 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)2 FeatureDependencySpec (org.jboss.galleon.spec.FeatureDependencySpec)2 ProvisioningException (org.jboss.galleon.ProvisioningException)1 ConfigItem (org.jboss.galleon.config.ConfigItem)1 ConfigModel (org.jboss.galleon.config.ConfigModel)1 FeatureConfig (org.jboss.galleon.config.FeatureConfig)1 FeatureGroup (org.jboss.galleon.config.FeatureGroup)1 CapabilitySpec (org.jboss.galleon.spec.CapabilitySpec)1 ConfigLayerDependency (org.jboss.galleon.spec.ConfigLayerDependency)1 FeatureAnnotation (org.jboss.galleon.spec.FeatureAnnotation)1 FeatureId (org.jboss.galleon.spec.FeatureId)1 FeaturePackPlugin (org.jboss.galleon.spec.FeaturePackPlugin)1 FeatureParameterSpec (org.jboss.galleon.spec.FeatureParameterSpec)1 FeatureReferenceSpec (org.jboss.galleon.spec.FeatureReferenceSpec)1 PackageDependencySpec (org.jboss.galleon.spec.PackageDependencySpec)1