Class Project

  • All Implemented Interfaces:

    
    public final class Project
    
                        

    A class describing a software project. A Project is very similar to a Package but contains some additional metadata like e.g. the homepageUrl. Most importantly, it defines the dependency scopes that refer to the actual packages.

    • Method Detail

      • getScopes

         final Set<Scope> getScopes()

        The dependency scopes defined by this project. This property provides access to scope-related information, no matter whether this information has been initialized directly or has been encoded in a DependencyGraph.

      • getId

         final Identifier getId()

        The unique identifier of this project. The id's type is the name of the package manager that manages this project (e.g. "Gradle" for a Gradle project).

      • getDeclaredLicenses

         final Set<String> getDeclaredLicenses()

        The set of licenses declared for this project. This does not necessarily correspond to the licenses as detected by a scanner. Both need to be taken into account for any conclusions.

      • getDeclaredLicensesProcessed

         final ProcessedDeclaredLicense getDeclaredLicensesProcessed()

        The declared licenses as SpdxExpression. If declaredLicenses contains multiple licenses they are concatenated with SpdxOperator.AND.

      • getVcs

         final VcsInfo getVcs()

        Original VCS-related information as defined in the Project's metadata.

      • getScopeDependencies

         final Set<Scope> getScopeDependencies()

        Holds information about the scopes and their dependencies of this project if no DependencyGraph is available. NOTE: Do not use this property to access scope information. Use scopes instead, which is correctly initialized in all cases.

      • getScopeNames

         final Set<String> getScopeNames()

        Contains dependency information as a set of scope names in case a shared DependencyGraph is used. The scopes of this project and their dependencies can then be constructed as the corresponding sub graph of the shared graph.

      • withResolvedScopes

         final Project withResolvedScopes(DependencyGraph graph)

        Return a Project instance that has its scope information directly available, resolved from the given graph. This function can be used to create a fully initialized Project if dependency information is available in a shared DependencyGraph. In this case, the set with Scopes is constructed as a subset of the provided shared graph. Otherwise, result is this same object.

      • contains

         final Boolean contains(Identifier id)

        Return whether the package identified by id is contained as a (transitive) dependency in this project.