Interface IModule

  • All Known Implementing Classes:
    DefaultSingleModule, SimpleModule

    public interface IModule
    Java projects are typically organized according to a hierarchy of modules where each module defines packages of Java classes and resources and other modules on which it depends. IModule abstracts this concept as a set of paths defining source, class, and output locations, a list of dependencies on other modules, and the set of ITypeManifolds managed by the module.

    The use of modules for the purposes of the Manifold API is mostly applicable to IDE integration such as with the IntelliJ plugin. Otherwise, because compilation is not intermodular and because runtime is flattened, modules consist of a single "default" module.

    • Method Detail

      • getSourcePath

        List<IDirectory> getSourcePath()
        The path[s] having source files that should be exposed to this module.
      • getCollectiveJavaClassPath

        List<IDirectory> getCollectiveJavaClassPath()
      • getDependencies

        List<Dependency> getDependencies()
        Returns:
        A list of dependency modules. The dependency graph must not have cycles.
      • findTypeManifoldsFor

        default Set<ITypeManifold> findTypeManifoldsFor​(String fqn,
                                                        Predicate<ITypeManifold> predicate)
        Finds the set of type manifolds that contribute toward the definition of a given type.
        Parameters:
        fqn - A fully qualified type name
        predicate - A predicate to filter the set of type manifolds available
        Returns:
        The set of type manifolds that contribute toward the definition of fqn
      • findTypeManifoldsFor

        default Set<ITypeManifold> findTypeManifoldsFor​(IFile file,
                                                        Predicate<ITypeManifold> predicate)
        Finds the set of type manifolds that handle a given resource file.
        Parameters:
        file - A resource file
        predicate - A predicate to filter the set of type manifolds available
        Returns:
        The set of type manifolds that handle file
      • loadTypeManifolds

        default SortedSet<ITypeManifold> loadTypeManifolds()
        Loads, but does not initialize, all type manifolds managed by this module.
        Returns:
        The complete set of type manifolds this module manages.
      • getTypeManifoldSorter

        default Comparator<ITypeManifold> getTypeManifoldSorter()
        Supplemental type manifolds must follow others, this is so that a Supplemental manifold in response to changes can be sure that side effects stemming from Primary or Partial manifolds are deterministic and complete beforehand.

        Implementors must maintain this as the primary sort.

      • getExcludedTypeManifolds

        default List<String> getExcludedTypeManifolds()