private List<ExportPackageDescription> creatExportPackage(Capability capability) { Map<String, Object> attributes = new HashMap<String, Object>(capability.getAttributes()); Map<String, String> directives = capability.getDirectives(); String packageName = (String) attributes.remove(PackageNamespace.PACKAGE_NAMESPACE); // remove invalid attributes attributes.remove(PackageNamespace.CAPABILITY_BUNDLE_SYMBOLICNAME_ATTRIBUTE); attributes.remove(AbstractWiringNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); String declaration = packageName + toString(attributes, "=", true) + toString(directives, ":=", true); //$NON-NLS-1$//$NON-NLS-2$ List<ExportPackageDescription> result = state.getFactory().createExportPackageDescriptions(declaration); for (ExportPackageDescription export : result) { export.setUserObject(capability); } return result; }
private List<ExportPackageDescription> creatExportPackage(Capability capability) { Map<String, Object> attributes = new HashMap<>(capability.getAttributes()); Map<String, String> directives = capability.getDirectives(); String packageName = (String) attributes.remove(PackageNamespace.PACKAGE_NAMESPACE); // remove invalid attributes attributes.remove(PackageNamespace.CAPABILITY_BUNDLE_SYMBOLICNAME_ATTRIBUTE); attributes.remove(AbstractWiringNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); String declaration = packageName + toString(attributes, "=", true) + toString(directives, ":=", true); //$NON-NLS-1$//$NON-NLS-2$ List<ExportPackageDescription> result = state.getFactory().createExportPackageDescriptions(declaration); for (ExportPackageDescription export : result) { export.setUserObject(capability); } return result; }