Class ImportPackageBuilder


  • public class ImportPackageBuilder
    extends Object
    The import package builder is used to analyze the classes and dependencies of the project and calculate the import-package statement for this package.
    • Constructor Detail

      • ImportPackageBuilder

        public ImportPackageBuilder()
    • Method Detail

      • withClassFileDirectory

        @NotNull
        public @NotNull ImportPackageBuilder withClassFileDirectory​(File classes)
        Sets the class files directory
        Parameters:
        classes - the directory
        Returns:
        this.
      • withDependenciesFromProject

        @NotNull
        public @NotNull ImportPackageBuilder withDependenciesFromProject​(@NotNull
                                                                         @NotNull org.apache.maven.project.MavenProject project)
        defines the project from which the artifacts should be loaded. The current implementation requires the filter to be set before calling this method.
        Parameters:
        project - the maven project
        Returns:
        this
      • withIncludeUnused

        @NotNull
        public @NotNull ImportPackageBuilder withIncludeUnused​(boolean includeUnused)
        defines if unused packages should be included if no classes exist in the project.
        Parameters:
        includeUnused - true to include unused.
        Returns:
        this
      • withFilter

        @NotNull
        public @NotNull ImportPackageBuilder withFilter​(@NotNull
                                                        @NotNull org.apache.maven.artifact.resolver.filter.ArtifactFilter filter)
        defines the filter for the project artifact
        Parameters:
        filter - the filter
        Returns:
        this
      • getImportParameters

        @NotNull
        public @NotNull Map<String,​aQute.bnd.header.Attrs> getImportParameters()
        returns the import parameter header. only available after analyze()
        Returns:
        the parameters
      • createExportPackageReport

        @NotNull
        public @NotNull String createExportPackageReport()
        generates a package report
        Returns:
        the report