KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > text > bundle > ExportPackageHeader


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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