01: /*******************************************************************************
02: * Copyright (c) 2005, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core.text.bundle;
11:
12: import java.util.Vector;
13:
14: import org.eclipse.osgi.util.ManifestElement;
15: import org.eclipse.pde.internal.core.ibundle.IBundle;
16:
17: public class ExportPackageHeader extends BasePackageHeader {
18:
19: private static final long serialVersionUID = 1L;
20:
21: public ExportPackageHeader(String name, String value,
22: IBundle bundle, String lineDelimiter) {
23: super (name, value, bundle, lineDelimiter);
24: }
25:
26: protected PDEManifestElement createElement(ManifestElement element) {
27: return new ExportPackageObject(this , element,
28: getVersionAttribute());
29: }
30:
31: public Vector getPackageNames() {
32: return getElementNames();
33: }
34:
35: public ExportPackageObject getPackage(String packageName) {
36: return (fElementMap == null || packageName == null) ? null
37: : (ExportPackageObject) fElementMap.get(packageName);
38: }
39:
40: public ExportPackageObject[] getPackages() {
41: PDEManifestElement[] elements = getElements();
42: ExportPackageObject[] result = new ExportPackageObject[elements.length];
43: System.arraycopy(elements, 0, result, 0, elements.length);
44: return result;
45: }
46:
47: public ExportPackageObject addPackage(String id) {
48: ExportPackageObject obj = new ExportPackageObject(this, id,
49: null, getVersionAttribute());
50: addManifestElement(obj);
51: return obj;
52: }
53:
54: }
|