Interface ModulePathElement

All Superinterfaces:
CodeContribution, Resource

public interface ModulePathElement extends CodeContribution

Marker interface for code contributions that contain a module descriptor and can be placed on the module-path (--module-path) during compilation or run-time.

A resource implementing this interface explicitly declares itself as a named module. Even without this marker, a CodeContribution can be detected as modular, see CodeContribution.isModular().

  • Method Details

    • isModular

      default boolean isModular()
      Description copied from interface: CodeContribution
      Checks whether this code contribution is modular. This works for both JAR files and directories. Both are considered as modular if they contain a module-info.class. JARs are also considered as modular if they have an Automatic-Module-Name set in their MANIFEST.MF.
      Specified by:
      isModular in interface CodeContribution
      Returns:
      true, if the contribution is modular