KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > model > bundle > ImportPackageHeader


1 /*******************************************************************************
2  * Copyright (c) 2005 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.ui.model.bundle;
12
13 import org.eclipse.osgi.util.ManifestElement;
14 import org.eclipse.pde.internal.core.ibundle.IBundle;
15 import org.osgi.framework.BundleException;
16
17 public class ImportPackageHeader extends BasePackageHeader {
18
19     private static final long serialVersionUID = 1L;
20
21     public ImportPackageHeader(String JavaDoc name, String JavaDoc value, IBundle bundle,
22             String JavaDoc lineDelimiter) {
23         super(name, value, bundle, lineDelimiter);
24     }
25
26     protected void processValue() {
27         try {
28             if (fValue != null) {
29                 ManifestElement[] elements = ManifestElement.parseHeader(fName, fValue);
30                 for (int i = 0; i < elements.length; i++) {
31                     ImportPackageObject p = new ImportPackageObject(this, elements[i], getVersionAttribute());
32                     fPackages.put(p.getName(), p);
33                 }
34             }
35         } catch (BundleException e) {
36         }
37     }
38     
39     public ImportPackageObject[] getPackages() {
40         return (ImportPackageObject[])fPackages.values().toArray(new ImportPackageObject[fPackages.size()]);
41     }
42     
43
44
45 }
46
Popular Tags