/** * @deprecated Use * {@link #mergeIntoCommaSeparatedList(String, Set, Wrapper, String)} * instead. */ @Deprecated public static String mergeIntoCommaSeparatedList(String currentString, Set<String> toMergeIn, Wrapper<Boolean> modified) { return mergeIntoCommaSeparatedList(currentString, toMergeIn, modified, LINEBREAK); }
public void addImportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(IMPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified); this.modified = modified.get(); getMainAttributes().put(IMPORT_PACKAGE, result); }
/** * adds the qualified names to the require-bundle attribute, if not already * present. * * @param bundles - passing parameterized bundled (e.g. versions, etc.) is not supported */ public void addRequiredBundles(Set<String> bundles) { // TODO manage transitive dependencies // don't require self Set<String> bundlesToMerge; String bundleName = (String) getMainAttributes().get(BUNDLE_NAME); if (bundleName != null && bundles.contains(bundleName) || projectName != null && bundles.contains(projectName)) { bundlesToMerge = new LinkedHashSet<String>(bundles); bundlesToMerge.remove(bundleName); bundlesToMerge.remove(projectName); } else { bundlesToMerge = bundles; } String s = (String) getMainAttributes().get(REQUIRE_BUNDLE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified); this.modified = modified.get(); getMainAttributes().put(REQUIRE_BUNDLE, result); }
/** * adds the qualified names to the export-package attribute, if not already * present. * * @param packages - passing parameterized packages is not supported */ public void addExportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(EXPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified); this.modified = modified.get(); getMainAttributes().put(EXPORT_PACKAGE, result); }
String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(REQUIRE_BUNDLE, result);
public void addImportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(IMPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(IMPORT_PACKAGE, result); }
/** * adds the qualified names to the export-package attribute, if not already * present. * * @param packages - passing parameterized packages is not supported */ public void addExportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(EXPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(EXPORT_PACKAGE, result); }