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()); } } }
FeaturePackPackagesConfigParser10.readPackages(reader, depBuilder); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse " + Element.PACKAGES.getLocalName() + ": " + e.getLocalizedMessage(), reader.getLocation(), e);
defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); addAttribute(defConfigsE, Attribute.INHERIT, FALSE); defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); final ElementNode exclude = addElement(defConfigsE, Element.EXCLUDE.getLocalName(), ns); addAttribute(exclude, Attribute.MODEL, excluded.getKey()); if(!excluded.getValue()) { defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); final ElementNode included = addElement(defConfigsE, Element.INCLUDE.getLocalName(), ns); addAttribute(included, Attribute.MODEL, modelName); defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); final ElementNode excluded = addElement(defConfigsE, Element.EXCLUDE.getLocalName(), ns); if(configId.getModel() != null) { addAttribute(excluded, Attribute.MODEL, configId.getModel()); defConfigsE = addElement(parent, Element.DEFAULT_CONFIGS.getLocalName(), ns); final ElementNode includeElement = addElement(defConfigsE, Element.INCLUDE.getLocalName(), ns); if(config.getModel() != null) { addAttribute(includeElement, Attribute.MODEL, config.getModel());
addAttribute(fp, Attribute.LOCATION, location.toString()); if(origin != null) { addElement(fp, Element.ORIGIN.getLocalName(), ns).addChild(new TextNode(origin)); final ElementNode patches = addElement(fp, Element.PATCHES.getLocalName(), ns); for(FPID patchId : featurePack.getPatches()) { final ElementNode patch = addElement(patches, Element.PATCH.getLocalName(), ns); addAttribute(patch, Attribute.ID, patchId.toString()); packages = addElement(fp, Element.PACKAGES.getLocalName(), ns); addAttribute(packages, Attribute.INHERIT, FALSE); packages = addElement(fp, Element.PACKAGES.getLocalName(), ns); final ElementNode exclude = addElement(packages, Element.EXCLUDE.getLocalName(), ns); addAttribute(exclude, Attribute.NAME, excluded); packages = addElement(fp, Element.PACKAGES.getLocalName(), ns); final ElementNode include = addElement(packages, Element.INCLUDE.getLocalName(), ns); addAttribute(include, Attribute.NAME, included.getName());
private static void writeUniverseConfig(ElementNode universesEl, String name, String factory, String location) { final ElementNode universeEl = addElement(universesEl, Element.UNIVERSE.getLocalName(), universesEl.getNamespace()); if(name != null) { addAttribute(universeEl, Attribute.NAME, name); } addAttribute(universeEl, Attribute.FACTORY, factory); if(location != null) { addAttribute(universeEl, Attribute.LOCATION, location); } }