Interface IModuleBinding
- All Superinterfaces:
IBinding
A module binding represents a module (added in JLS9 API).
- Since:
- 3.14
-
Field Summary
Fields inherited from interface IBinding
ANNOTATION, MEMBER_VALUE_PAIR, METHOD, MODULE, PACKAGE, TYPE, VARIABLEModifier and TypeFieldDescriptionstatic final intKind constant (value 5) indicating an annotation binding.static final intKind constant (value 6) indicating a member value pair binding.static final intKind constant (value 4) indicating a method or constructor binding.static final intKind constant (value 7) indicating a module binding (added in JLS9 API).static final intKind constant (value 1) indicating a package binding.static final intKind constant (value 2) indicating a type binding.static final intKind constant (value 3) indicating a field or local variable binding. -
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 intgetKind()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 all modules that are required with the modifier "transitive".Returns the services provided by this module.getUses()Returns the services used by this module.booleanisOpen()Returns whether this module is open or not.Methods inherited from interface IBinding
equals, getAnnotations, getJavaElement, getKey, getModifiers, getName, isDeprecated, isEqualTo, isRecovered, isSynthetic, toStringModifier and TypeMethodDescriptionbooleanThere is no special definition of equality for bindings; equality is simply object identity.Returns the resolved declaration annotations associated with this binding.Returns the Java element that corresponds to this binding.getKey()Returns the key for this binding.intReturns the modifiers for this binding.getName()Returns the name of this binding.booleanReturn whether this binding is for something that is deprecated.booleanReturns whether this binding has the same key as that of the given binding.booleanReturn whether this binding is created because the bindings recovery is enabled.booleanReturns whether this binding is synthetic.toString()Returns a string representation of this binding suitable for debugging purposes only.
-
Method Details
-
getKind
default int getKind()Description copied from interface:IBindingReturns 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:
trueif open,falseotherwise
-
getRequiredModules
IModuleBinding[] getRequiredModules()Returns all required modules.The resulting bindings are in no particular order.
- Returns:
- all required modules
-
getRequiredTransitiveModules
IModuleBinding[] getRequiredTransitiveModules()Returns all modules that are required with the modifier "transitive".The resulting bindings are in no particular order.
- Returns:
- modules required with the modifier "transitive"
- Since:
- 3.44
-
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
-