@SuppressWarnings("unchecked") public B excludeFeature(String origin, FeatureId featureId, String parentRef) throws ProvisioningDescriptionException { if(origin == null) { return excludeFeature(featureId, parentRef); } getExternalFgConfig(origin).excludeFeature(featureId, parentRef); return (B) this; }
@SuppressWarnings("unchecked") public B excludeSpec(String origin, String spec) throws ProvisioningDescriptionException { if(origin == null) { return excludeSpec(spec); } getExternalFgConfig(origin).excludeSpec(spec); return (B) this; }
@SuppressWarnings("unchecked") private B includeFeature(String origin, FeatureId featureId, FeatureConfig feature) throws ProvisioningDescriptionException { if(origin == null) { return includeFeature(featureId, feature); } getExternalFgConfig(origin).includeFeature(featureId, feature); return (B) this; }
@SuppressWarnings("unchecked") public B includeSpec(String origin, String spec) throws ProvisioningDescriptionException { if(origin == null) { return includeSpec(spec); } getExternalFgConfig(origin).includeSpec(spec); return (B) this; }
public static boolean handleFeatureGroupBodyElement(XMLExtendedStreamReader reader, FeatureGroupBuilderSupport<?> builder) throws XMLStreamException { final Element element = Element.of(reader.getName().getLocalPart()); switch (element) { case INCLUDE: readInclude(reader, null, builder); break; case EXCLUDE: readExclude(reader, null, builder); break; case ORIGIN: readOriginIncludeExclude(reader, builder); break; case FEATURE_GROUP: builder.addFeatureGroup(readFeatureGroupDependency(null, reader)); break; case FEATURE: final FeatureConfig nested = new FeatureConfig(); readFeatureConfig(reader, nested); builder.addFeature(nested); break; case PACKAGES: PackageDepsSpecXmlParser.parsePackageDeps(Element.PACKAGES, reader, builder); break; default: return false; } return true; }
depBuilder.excludeSpec(dependency, spec); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse config", e); depBuilder.excludeFeature(dependency, parseFeatureId(featureIdStr), parentRef); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse config", e);
depBuilder.includeSpec(origin, spec); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse config", e); case XMLStreamConstants.END_ELEMENT: try { depBuilder.includeFeature(featureId, fc); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse config", e);
public B excludeFeature(String origin, FeatureId featureId) throws ProvisioningDescriptionException { return excludeFeature(origin, featureId, null); }
public B includeFeature(FeatureId featureId) throws ProvisioningDescriptionException { return includeFeature(featureId, null); }
@SuppressWarnings("unchecked") public B includeFeature(FeatureId featureId, FeatureConfig feature) throws ProvisioningDescriptionException { if(feature != null && feature.getOrigin() != null) { final String origin = feature.getOrigin(); feature.setOrigin(null); getExternalFgConfig(origin).includeFeature(featureId, feature); return (B) this; } if(excludedFeatures.containsKey(featureId)) { throw new ProvisioningDescriptionException(featureId + " has been explicitly excluded"); } if(feature == null) { feature = new FeatureConfig(featureId.getSpec()); } else if(feature.specId == null) { feature.specId = featureId.getSpec(); } for (Map.Entry<String, String> idEntry : featureId.getParams().entrySet()) { final String prevValue = feature.putParam(idEntry.getKey(), idEntry.getValue()); if (prevValue != null && !prevValue.equals(idEntry.getValue())) { throw new ProvisioningDescriptionException("Parameter " + idEntry.getKey() + " has value '" + idEntry.getValue() + "' in feature ID and value '" + prevValue + "' in the feature body"); } } includedFeatures = CollectionUtils.putLinked(includedFeatures, featureId, feature); return (B) this; }
break; case FEATURE_GROUP: builder.addFeatureGroup(readFeatureGroupDependency(origin, reader)); break; case FEATURE: nested.setOrigin(origin); readFeatureConfig(reader, nested); builder.addFeature(nested); break; case PACKAGES:
public B excludeFeature(FeatureId featureId) throws ProvisioningDescriptionException { return excludeFeature(featureId, null); }
public B includeFeature(String origin, FeatureId featureId) throws ProvisioningDescriptionException { return includeFeature(origin, featureId, null); }