1 11 package org.eclipse.pde.internal.core.text.bundle; 12 13 import org.eclipse.osgi.util.ManifestElement; 14 import org.eclipse.pde.internal.core.ibundle.IBundle; 15 16 public class ImportPackageHeader extends BasePackageHeader { 17 18 private static final long serialVersionUID = 1L; 19 20 public ImportPackageHeader(String name, String value, IBundle bundle, String lineDelimiter) { 21 super(name, value, bundle, lineDelimiter); 22 } 23 24 protected PDEManifestElement createElement(ManifestElement element) { 25 return new ImportPackageObject(this, element, getVersionAttribute()); 26 } 27 28 public ImportPackageObject getPackage(String packageName) { 29 return (fElementMap == null) ? null : (ImportPackageObject) fElementMap.get(packageName); 30 } 31 32 public ImportPackageObject[] getPackages() { 33 PDEManifestElement[] elements = getElements(); 34 ImportPackageObject[] result = new ImportPackageObject[elements.length]; 35 System.arraycopy(elements, 0, result, 0, elements.length); 36 return result; 37 } 38 39 public ImportPackageObject addPackage(String id) { 40 ImportPackageObject obj = new ImportPackageObject(this, id, null, getVersionAttribute()); 41 addManifestElement(obj); 42 return obj; 43 } 44 45 } 46 | Popular Tags |