Package org.eclipse.jdt.core.dom
Interface IModuleBinding
- All Superinterfaces:
IBinding
A module binding represents a module (added in JLS9 API).
- Since:
- 3.14
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
Fields inherited from interface org.eclipse.jdt.core.dom.IBinding
ANNOTATION, MEMBER_VALUE_PAIR, METHOD, MODULE, PACKAGE, TYPE, VARIABLE
-
Method Summary
Modifier and TypeMethodDescriptionReturns all exported packages.String[]
getExportedTo
(IPackageBinding packageBinding) If this module exports the given package to specific modules, returns the array of names of modules, otherwise returns an empty array.getImplementations
(ITypeBinding service) Returns the implementations that implement the given service in this module.default int
getKind()
Returns the kind of bindings this is.Returns all opened packages.String[]
getOpenedTo
(IPackageBinding packageBinding) If this module opens the given package to specific modules, returns the array of names of modules, otherwise returns an empty array.Returns all required modules.Returns the services provided by this module.getUses()
Returns the services used by this module.boolean
isOpen()
Returns whether this module is open or not.Methods inherited from interface org.eclipse.jdt.core.dom.IBinding
equals, getAnnotations, getJavaElement, getKey, getModifiers, getName, isDeprecated, isEqualTo, isRecovered, isSynthetic, toString
-
Method Details
-
getKind
default int getKind()Description copied from interface:IBinding
Returns the kind of bindings this is. That is one of the kind constants:PACKAGE
,TYPE
,VARIABLE
,METHOD
,ANNOTATION
,MEMBER_VALUE_PAIR
, orMODULE
.Note that additional kinds might be added in the future, so clients should not assume this list is exhaustive and should program defensively, e.g. by having a reasonable default in a switch statement.
-
isOpen
boolean isOpen()Returns whether this module is open or not.- Returns:
true
if open,false
otherwise
-
getRequiredModules
IModuleBinding[] getRequiredModules()Returns all required modules.The resulting bindings are in no particular order.
- Returns:
- all required modules
-
getExportedPackages
IPackageBinding[] getExportedPackages()Returns all exported packages.The resulting bindings are in no particular order.
- Returns:
- array of exported package bindings
-
getExportedTo
If this module exports the given package to specific modules, returns the array of names of modules, otherwise returns an empty array.- Parameters:
packageBinding
- a package binding for which targeted modules are declared- Returns:
- array of names of targeted modules
-
getOpenedPackages
IPackageBinding[] getOpenedPackages()Returns all opened packages.The resulting bindings are in no particular order.
- Returns:
- array of package bindings
-
getOpenedTo
If this module opens the given package to specific modules, returns the array of names of modules, otherwise returns an empty array.The resulting bindings are in no particular order.
- Parameters:
packageBinding
- a package binding for which targeted modules are declared- Returns:
- array of names of targeted modules
-
getUses
ITypeBinding[] getUses()Returns the services used by this module.The resulting bindings are in no particular order.
- Returns:
- array of type bindings
-
getServices
ITypeBinding[] getServices()Returns the services provided by this module.The resulting services are in no particular order.
- Returns:
- array of services
-
getImplementations
Returns the implementations that implement the given service in this module.- Returns:
- array of implementation type bindings, in declaration order
-