Class LicenseAnalyst

java.lang.Object
org.apache.creadur.whisker.app.analysis.LicenseAnalyst

public class LicenseAnalyst extends Object
Analyses licenses.
  • Constructor Details

    • LicenseAnalyst

      public LicenseAnalyst()
      Constructs empty analyst.
    • LicenseAnalyst

      public LicenseAnalyst(Collection<org.apache.creadur.whisker.scan.Directory> directories)
      Analyse the given directories.
      Parameters:
      directories - not null
  • Method Details

    • analyse

      public LicenseAnalyst analyse(org.apache.creadur.whisker.model.Descriptor work)
      Discover discrepancies between meta-data and source directories.
      Parameters:
      work - not null
      Returns:
      this, not null
    • isValid

      public boolean isValid()
      Were any errors found?
      Returns:
      true when the meta-data is valid, false otherwise
    • validate

      public org.apache.creadur.whisker.model.Descriptor validate(org.apache.creadur.whisker.model.Descriptor work) throws ResourceDefinitionException
      Checks the descriptor against the source directories.
      Parameters:
      work - not null
      Returns:
      valid meta-data
      Throws:
      ResourceDefinitionException - when issues are found
    • getResourcesMissingSources

      public Collection<ResourceDescription> getResourcesMissingSources()
      Gets resources whose sources are missing.
      Returns:
      not null, possibly empty
    • getExtraLicenses

      public Collection<ResourceDescription> getExtraLicenses()
      Gets surplus licenses.
      Returns:
      not null, possibly empty
    • getMissingLicenses

      public Collection<ResourceDescription> getMissingLicenses()
      Gets missing license.
      Returns:
      not null, possibly empty
    • getDuplicates

      public Collection<ResourceDescription> getDuplicates()
      Gets duplicate resources.
      Returns:
      the duplicates
    • getIssues

      Gets issues by type.
      Parameters:
      ofType - not null
      Returns:
      issues of given type, not null, possibly empty
    • toString

      public String toString()
      Describes suitably for logging.
      Overrides:
      toString in class Object
      Returns:
      something suitable for logging
      See Also: