Class DefaultPolicy

java.lang.Object
org.apache.rat.policy.DefaultPolicy
All Implemented Interfaces:
IDocumentAnalyser

public class DefaultPolicy extends Object implements IDocumentAnalyser
A default Document Analyser that determines if the matched license is in the set of approved licenses.
  • Constructor Details

    • DefaultPolicy

      public DefaultPolicy(Collection<ILicenseFamily> approvedLicenseFamilies)
      Constructor with the list of approved license families.
      Parameters:
      approvedLicenseFamilies - the approved license families.
  • Method Details

    • add

      public void add(ILicenseFamily approvedLicense)
      adds an ILicenseFamily to the list of approved licenses.
      Parameters:
      approvedLicense - license to be approved.
    • analyse

      public void analyse(Document document)
      Specified by:
      analyse in interface IDocumentAnalyser
    • reportLicenseApprovalClaim

      public void reportLicenseApprovalClaim(Document document, boolean isAcceptable)
      Report if the document as either having approved license or not.
      Parameters:
      document - the document to approve.
      isAcceptable - true if the license is an approved one, false otherwise.
    • getApprovedLicenseNames

      public SortedSet<ILicenseFamily> getApprovedLicenseNames()
      Gets an unmodifiable reference to the SortedSet of approved licenses that this policy is holding.
      Returns:
      sorted set of license family definitions.