protected ElementNode toElement(PackageSpec pkgSpec) { final ElementNode pkg = addElement(null, Element.PACKAGE_SPEC); addAttribute(pkg, Attribute.NAME, pkgSpec.getName()); if(pkgSpec.hasPackageDeps()) { writePackageDeps(pkgSpec, addElement(pkg, Element.DEPENDENCIES.getLocalName(), Element.DEPENDENCIES.getNamespace())); } return pkg; }
protected ElementNode toElement(FeatureGroup featureGroup, String ns) { final ElementNode fgE = addElement(null, Element.FEATURE_GROUP_SPEC.getLocalName(), ns); if(featureGroup.getName() != null) { addAttribute(fgE, Attribute.NAME, featureGroup.getName()); } //addFeatureGroupIncludeExclude(featureGroup, ns, fgE); writeFeatureGroupSpecBody(fgE, featureGroup, ns); if(featureGroup.hasPackageDeps()) { PackageXmlWriter.writePackageDeps(featureGroup, addElement(fgE, Element.PACKAGES.getLocalName(), ns)); } return fgE; }
public static void addFeatureGroupDepBody(FeatureGroupSupport dep, final ElementNode depE, String ns) { if(dep.getName() != null) { addAttribute(depE, Attribute.NAME, dep.getName()); } if(!dep.isInheritFeatures()) { addAttribute(depE, Attribute.INHERIT_FEATURES, FALSE); } addFeatureGroupIncludeExclude(dep, ns, depE); writeFeatureGroupSpecBody(depE, dep, ns); if(dep.hasExternalFeatureGroups()) { for(Map.Entry<String, FeatureGroup> entry : dep.getExternalFeatureGroups().entrySet()) { final ElementNode fpE = addElement(depE, Element.ORIGIN.getLocalName(), ns); addAttribute(fpE, Attribute.NAME, entry.getKey()); addFeatureGroupIncludeExclude(entry.getValue(), ns, fpE); } } if(dep.hasPackageDeps()) { PackageXmlWriter.writePackageDeps(dep, addElement(depE, Element.PACKAGES.getLocalName(), ns)); } }
PackageXmlWriter.writePackageDeps(featureSpec, addElement(specE, Element.PACKAGES));