org.eclipse.jdt.core.dom.IModuleBinding Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* 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 true
if open, false
otherwise
*/
public abstract boolean isOpen();
/**
* Returns all required modules.
* The resulting bindings are in no particular order.
*
* @return all required modules
*/
public abstract IModuleBinding[] getRequiredModules();
/**
* Returns all exported packages.
* The resulting bindings are in no particular order.
*
* @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.
* The resulting bindings are in no particular order.
*
* @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.
* The resulting bindings are in no particular order.
*
* @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.
* The resulting bindings are in no particular order.
*
* @return array of type bindings
*/
public abstract ITypeBinding[] getUses();
/**
* Returns the services provided by this module.
* The resulting services are in no particular order.
*
* @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);
}