public ElementNode(final ElementNode parent, final String name) { this(parent, name, parent.getNamespace()); }
static void writePackageDeps(PackageDepsSpec pkgDeps, ElementNode deps) { if(pkgDeps.hasLocalPackageDeps()) { for(PackageDependencySpec depSpec : pkgDeps.getLocalPackageDeps()) { writePackageDependency(deps, depSpec, deps.getNamespace()); } } if(pkgDeps.hasExternalPackageDeps()) { for(String origin : pkgDeps.getPackageOrigins()) { writeOrigin(deps, origin, pkgDeps.getExternalPackageDeps(origin), deps.getNamespace()); } } }
@Override public void nextFeaturePack(FPID fpid) { fpElement = addElement(parent, Element.FEATURE_PACK.getLocalName(), parent.getNamespace()); addAttribute(fpElement, Attribute.LOCATION, fpid.toString()); }
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()); } } }
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); } }
@Override public void nextSpec(ResolvedFeatureSpec spec) { specElement = addElement(fpElement, Element.SPEC.getLocalName(), parent.getNamespace()); addAttribute(specElement, Attribute.NAME, spec.getId().getName()); }
@Override public void nextFeature(ProvisionedFeature feature) throws ProvisioningException { final ElementNode featureE = addElement(specElement, Element.FEATURE.getLocalName(), parent.getNamespace()); if(feature.hasId()) { addAttribute(featureE, Attribute.ID, feature.getId().toString()); } if(feature.hasParams()) { for(String param : feature.getParamNames()) { final ElementNode paramE = addElement(featureE, Element.PARAM.getLocalName(), parent.getNamespace()); addAttribute(paramE, Attribute.NAME, param); addAttribute(paramE, Attribute.VALUE, feature.getConfigParam(param)); } } } }
static void writeFeaturePackConfig(ElementNode fp, FeaturePackLocation location, FeaturePackConfig featurePack, String origin) { final String ns = fp.getNamespace(); addAttribute(fp, Attribute.LOCATION, location.toString()); if(origin != null) {