Interface ModuleResourceResolver<T extends Module>

  • All Known Subinterfaces:
    ModuleService<T>

    public interface ModuleResourceResolver<T extends Module>
    • Method Detail

      • resolveModule

        T resolveModule​(org.uberfire.backend.vfs.Path resource)
        Given a Resource path resolve it to the containing Module Path. A Module path is the folder containing pom.xml
        Parameters:
        resource -
        Returns:
        Path to the folder containing the Module's pom.xml file or null if the resource was not in a Module
      • resolveModule

        T resolveModule​(org.uberfire.backend.vfs.Path resource,
                        boolean loadPOM)
        Given a Resource path resolve it to the containing Module Path. A Module path is the folder containing pom.xml
        Parameters:
        resource -
        loadPOM - true iff the POM file should be parsed and loaded.
        Returns:
        Path to the folder containing the Module's pom.xml file if loadPOM is true and it exists or else null.
      • resolveParentModule

        Module resolveParentModule​(org.uberfire.backend.vfs.Path resource)
      • resolveToParentModule

        Module resolveToParentModule​(org.uberfire.backend.vfs.Path resource)
      • resolvePackages

        Set<Package> resolvePackages​(Module module)
        Given a Module resolves the calculation of all the packages for this module.
        Parameters:
        module -
        Returns:
        Collection containing all the packages for the module.
      • resolvePackages

        Set<Package> resolvePackages​(Module module,
                                     Set<String> packageNames)
        Given a Module resolves the calculation of all the packages for this module for the given packages.
        Parameters:
        module -
        packageNames - For example ["org.test", "org.hello"]
        Returns:
        Collection containing all given packages for the module.
      • resolveDefaultPackage

        Package resolveDefaultPackage​(Module module)
      • resolveDefaultWorkspacePackage

        Package resolveDefaultWorkspacePackage​(Module module)
      • resolveDefaultPath

        org.uberfire.backend.vfs.Path resolveDefaultPath​(Package pkg,
                                                         String resourceType)
        Given a package and a resource extension resolves the target path where the resource should be placed by default. e.g. for a package org.kie and a drl extension, the by default target path will be src/main/resources/org/kie, and for a java extension with the same package the by default target path will be src/main/java/org/kie
        Parameters:
        pkg - A package within a module.
        resourceType - a file extension.
        Returns:
        the expected by default path for the given extension.
      • isPom

        boolean isPom​(org.uberfire.backend.vfs.Path resource)
        Return true if the file is the Module's pom.xml file
        Parameters:
        resource -
        Returns:
      • resolvePackage

        Package resolvePackage​(org.uberfire.backend.vfs.Path resource)
        Given a Resource path resolve it to the containing Package Path. A Package path is the folder containing the resource. The folder must be within a valid Module structure and at least reference /src/main/java, /src/main/resources, src/test/java or src/test/resources (or deeper).
        Parameters:
        resource -
        Returns:
        Path to the folder containing the resource file or null if the resource is not in a Package.