Class AbstractBasePackageConfigurationSorter<T extends AbstractScanConfiguration>

java.lang.Object
io.jmix.flowui.sys.AbstractBasePackageConfigurationSorter<T>
Type Parameters:
T - type of specific scan configuration
Direct Known Subclasses:
ActionsConfigurationSorter, ViewControllersConfigurationSorter

public abstract class AbstractBasePackageConfigurationSorter<T extends AbstractScanConfiguration> extends Object
Provides base functionality to sort the list of scan configurations in the same order as Jmix modules have been sorted using configuration base packages.
  • Field Details

  • Constructor Details

    • AbstractBasePackageConfigurationSorter

      public AbstractBasePackageConfigurationSorter(JmixModules jmixModules)
  • Method Details

    • sort

      public List<T> sort(List<T> configurations)
    • getBasePackages

      protected abstract List<String> getBasePackages(T configuration)
    • evaluateJmixModule

      @Nullable protected JmixModuleDescriptor evaluateJmixModule(Collection<String> basePackages)
      Finds Jmix module with a base package that matches any of given basePackages. Jmix module matches the package if its base package equals specified base package or if specified base package is a "subpackage" of Jmix module base package.
    • evaluateJmixModule

      @Nullable protected JmixModuleDescriptor evaluateJmixModule(String basePackage)
    • isNestedSubpackage

      protected boolean isNestedSubpackage(String package1, String package2)
      Returns true if package1 is a subpackage of package2, e.g. com.company.greeting.hello is a subpackage of com.company.greeting
    • charsCount

      protected long charsCount(String string, Character character)
      Returns count of specific character in a string