View Javadoc

1   /*
2    * Copyright 2006-2008 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.osgi.io.internal.resolver;
18  
19  import org.osgi.framework.Bundle;
20  
21  /**
22   * Importing bundle information.
23   * 
24   * @author Costin Leau
25   * 
26   */
27  public class ImportedBundle {
28  
29  	private final Bundle importingBundle;
30  
31  	private final String[] importedPackages;
32  
33  
34  	public ImportedBundle(Bundle importingBundle, String[] importedPackages) {
35  		super();
36  		this.importingBundle = importingBundle;
37  		this.importedPackages = importedPackages;
38  	}
39  
40  	/**
41  	 * Returns the imported bundle.
42  	 * 
43  	 * @return importing bundle
44  	 */
45  	public Bundle getBundle() {
46  		return importingBundle;
47  	}
48  
49  	/**
50  	 * 
51  	 * Returns an array of imported packages.
52  	 * 
53  	 * @return a non-null array of String representing the imported packages
54  	 */
55  	public String[] getImportedPackages() {
56  		return importedPackages;
57  	}
58  
59  	public String toString() {
60  		return importingBundle.toString();
61  	}
62  
63  }