Skip to main content
summaryrefslogtreecommitdiffstats
blob: bb6ebd1953d41b74c322af7bfbb00f0e419fd29f (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*******************************************************************************
 * Copyright (c) 2017 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.jdt.core.dom;

/**
 * A module binding represents a module (added in JLS9 API).
 *
 * @since 3.14
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IModuleBinding extends IBinding {

	@Override
	public default int getKind() {
		return IBinding.MODULE;
	}

	/**
	 * Returns whether this module is open or not.
	 *
	 * @return <code>true</code> if open, <code>false</code> otherwise
	 */
	public abstract boolean isOpen();

	/**
	 * Returns all required modules.
	 * <p>The resulting bindings are in no particular order.</p>
	 *
	 * @return all required modules
	 */
	public abstract IModuleBinding[] getRequiredModules();

	/**
	 * Returns all exported packages.
	 * <p>The resulting bindings are in no particular order.</p>
	 *
	 * @return array of exported package bindings
	 */
	public abstract IPackageBinding[] getExportedPackages();

	/**
	 * If this module exports the given package to specific modules, returns the array of names of
	 * modules, otherwise returns an empty array.
	 *
	 * @param packageBinding a package binding for which targeted modules are declared
	 * @return array of names of targeted modules
	 */
	public abstract String[] getExportedTo(IPackageBinding packageBinding);

	/**
	 * Returns all opened packages.
	 * <p>The resulting bindings are in no particular order.</p>
	 *
	 * @return array of package bindings
	 */
	public abstract IPackageBinding[] getOpenedPackages();

	/**
	 * If this module opens the given package to specific modules, returns the array of names of
	 * modules, otherwise returns an empty array.
	 * <p>The resulting bindings are in no particular order.</p>
	 *
	 * @param packageBinding a package binding for which targeted modules are declared
	 * @return array of names of targeted modules
	 */
	public abstract String[] getOpenedTo(IPackageBinding packageBinding);

	/**
	 * Returns the services used by this module.
	 * <p>The resulting bindings are in no particular order.</p>
	 *
	 * @return array of type bindings
	 */
	public abstract ITypeBinding[] getUses();

	/**
	 * Returns the services provided by this module.
	 * <p>The resulting services are in no particular order.</p>
	 *
	 * @return array of services
	 */
	public abstract ITypeBinding[] getServices();

	/**
	 * Returns the implementations that implement the given service in this module.
	 *
	 * @return array of implementation type bindings, in declaration order
	 */
	public abstract ITypeBinding[] getImplementations(ITypeBinding service);
}

Back to the top