Skip to main content
summaryrefslogtreecommitdiffstats
blob: 348e8fd493945237aff105290037ecc4307f075f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2008, 2013 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.osgi.storage.bundlefile;

import org.eclipse.osgi.internal.hookregistry.BundleFileWrapperFactoryHook;

/**
 * Used to chain the BundleFile objects returned from {@link BundleFileWrapperFactoryHook}.  
 * This class is useful for traversing the chain of wrapped bundle files.
 */
public class BundleFileWrapperChain extends BundleFileWrapper {
	private final BundleFile wrapped;
	private final BundleFileWrapperChain next;

	public BundleFileWrapperChain(BundleFile wrapped, BundleFileWrapperChain next) {
		super(wrapped);
		this.wrapped = wrapped;
		this.next = next;
	}

	@Override
	public String toString() {
		return wrapped.toString();
	}

	/**
	 * The BundleFile that is wrapped
	 * @return the BunldeFile that is wrapped
	 */
	public BundleFile getWrapped() {
		return wrapped;
	}

	/**
	 * The next WrapperBundleFile in the chain.  A <code>null</code> value
	 * is returned if this is the end of the chain.
	 * @return the next WrapperBundleFile
	 */
	public BundleFileWrapperChain getNext() {
		return next;
	}
}

Back to the top