use of org.jboss.galleon.spec.SpecId in project galleon by wildfly.
the class FeatureGroupXmlWriter method addFeatureGroupIncludeExclude.
static void addFeatureGroupIncludeExclude(FeatureGroupSupport dep, String ns, final ElementNode depE) {
if (dep.hasExcludedSpecs()) {
for (SpecId spec : dep.getExcludedSpecs()) {
final ElementNode excludeE = addElement(depE, Element.EXCLUDE.getLocalName(), ns);
addAttribute(excludeE, Attribute.SPEC, spec.toString());
}
}
if (dep.hasExcludedFeatures()) {
for (Map.Entry<FeatureId, String> excluded : dep.getExcludedFeatures().entrySet()) {
final ElementNode excludeE = addElement(depE, Element.EXCLUDE.getLocalName(), ns);
addAttribute(excludeE, Attribute.FEATURE_ID, excluded.getKey().toString());
if (excluded.getValue() != null) {
addAttribute(excludeE, Attribute.PARENT_REF, excluded.getValue());
}
}
}
if (dep.hasIncludedSpecs()) {
for (SpecId spec : dep.getIncludedSpecs()) {
final ElementNode includeE = addElement(depE, Element.INCLUDE.getLocalName(), ns);
addAttribute(includeE, Attribute.SPEC, spec.toString());
}
}
if (dep.hasIncludedFeatures()) {
for (Map.Entry<FeatureId, FeatureConfig> entry : dep.getIncludedFeatures().entrySet()) {
final ElementNode includeE = addElement(depE, Element.INCLUDE.getLocalName(), ns);
addAttribute(includeE, Attribute.FEATURE_ID, entry.getKey().toString());
final FeatureConfig fc = entry.getValue();
if (fc.getParentRef() != null) {
addAttribute(includeE, Attribute.PARENT_REF, fc.getParentRef());
}
if (fc != null) {
addFeatureConfigBody(includeE, entry.getKey(), fc, ns);
}
}
}
}
use of org.jboss.galleon.spec.SpecId in project galleon by wildfly.
the class FeatureGroupBuilderSupport method excludeSpec.
@SuppressWarnings("unchecked")
public B excludeSpec(String spec) throws ProvisioningDescriptionException {
final SpecId specId = SpecId.fromString(spec);
if (includedSpecs.contains(specId)) {
throw new ProvisioningDescriptionException(specId + " spec has been inplicitly excluded");
}
excludedSpecs = CollectionUtils.add(excludedSpecs, specId);
return (B) this;
}
use of org.jboss.galleon.spec.SpecId in project galleon by wildfly.
the class FeatureGroupBuilderSupport method includeSpec.
@SuppressWarnings("unchecked")
public B includeSpec(String spec) throws ProvisioningDescriptionException {
final SpecId specId = SpecId.fromString(spec);
if (excludedSpecs.contains(specId)) {
throw new ProvisioningDescriptionException(specId + " spec has been explicitly excluded");
}
includedSpecs = CollectionUtils.addLinked(includedSpecs, specId);
return (B) this;
}
Aggregations