Class ImportPackageBuilder
- java.lang.Object
-
- org.apache.jackrabbit.filevault.maven.packaging.impl.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 Summary
Constructors Constructor Description ImportPackageBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ImportPackageBuilder
analyze()
analyzes the imports@NotNull String
createExportPackageReport()
generates a package report@NotNull Map<String,aQute.bnd.header.Attrs>
getImportParameters()
returns the import parameter header.@NotNull ImportPackageBuilder
withClassFileDirectory(File classes)
Sets the class files directory@NotNull ImportPackageBuilder
withDependenciesFromProject(@NotNull org.apache.maven.project.MavenProject project)
defines the project from which the artifacts should be loaded.@NotNull ImportPackageBuilder
withFilter(@NotNull org.apache.maven.artifact.resolver.filter.ArtifactFilter filter)
defines the filter for the project artifact@NotNull ImportPackageBuilder
withIncludeUnused(boolean includeUnused)
defines if unused packages should be included if no classes exist in the project.
-
-
-
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
-
analyze
@NotNull public @NotNull ImportPackageBuilder analyze() throws IOException
analyzes the imports- Returns:
- this
- Throws:
IOException
- if an error occurrs.
-
getImportParameters
@NotNull public @NotNull Map<String,aQute.bnd.header.Attrs> getImportParameters()
returns the import parameter header. only available afteranalyze()
- Returns:
- the parameters
-
createExportPackageReport
@NotNull public @NotNull String createExportPackageReport()
generates a package report- Returns:
- the report
-
-