Class WithLicense

java.lang.Object
org.apache.creadur.whisker.model.WithLicense
All Implemented Interfaces:
Comparable<WithLicense>, ContentElement

public class WithLicense extends Object implements Comparable<WithLicense>, ContentElement
Groups resources sharing a license and claimed copyright.
  • Constructor Details

    • WithLicense

      public WithLicense(License license, String copyrightNotice, Map<String,String> parameters, Collection<ByOrganisation> organisations)
      Groups resources sharing a license and copyright claim.
      Parameters:
      license - License shared by contained resources, not null
      copyrightNotice - copyright claim shared by contained resources, possibly null
      parameters - parameters to specialise the license family template, not null
      organisations - resources grouped by responsible organisation, not null
  • Method Details

    • getCopyrightNotice

      public String getCopyrightNotice()
      Gets the copyright claim shared by the resources contained.
      Returns:
      possibly null
    • hasCopyrightNotice

      public boolean hasCopyrightNotice()
      Indicates whether a copyright notice accumpianies this license.
      Returns:
      true when getCopyrightNotice() is not null, false when getCopyrightNotice() is null
    • getName

      public String getName()
      Gets the presentation name for the license shared by the resources contained.
      Returns:
      not null
    • getURL

      public String getURL()
      Gets a locator for the license shared by the resources contained.
      Returns:
      not null
    • getLicense

      public License getLicense()
      Gets license meta-data shared by the resources contained.
      Returns:
      not null
    • getText

      public String getText() throws LicenseTemplateException
      Gets the license legalise shared by the resources contained. Computed by applying the parameters to the license template.
      Returns:
      not null
      Throws:
      LicenseTemplateException - when the license text cannot be generated from the template
    • getOrganisations

      public Collection<ByOrganisation> getOrganisations()
      Gets resources grouped by responsible organisation.
      Returns:
      not null
    • getParameters

      public Map<String,String> getParameters()
      Gets the parameters substituted into the license template when generating the license legalise.
      Returns:
      not null
    • compareTo

      public int compareTo(WithLicense other)
      Based on license.
      Specified by:
      compareTo in interface Comparable<WithLicense>
      Parameters:
      other - possibly null
      Returns:
      license comparison
      See Also:
    • accept

      public void accept(Visitor visitor)
      Accepts a visit.
      Specified by:
      accept in interface ContentElement
      Parameters:
      visitor - possibly null
    • isSourceRequired

      public boolean isSourceRequired()
      Should information about the source distribution of contained resources be included?
      Returns:
      true when license asks that information about the source distribution is included, false otherwise