Class RenderingHelper

java.lang.Object
org.apache.creadur.whisker.out.velocity.RenderingHelper

public class RenderingHelper extends Object
Factors out rendering logic from template.
  • Constructor Details

    • RenderingHelper

      public RenderingHelper(Descriptor work, Configuration configuration)
      Constructs a helper for the given work and configuration.
      Parameters:
      work - not null
      configuration - not null
  • Method Details

    • renderResources

      public boolean renderResources(ByOrganisation organisation, WithLicense license)
      Should resources with the given license by the given organisation be rendered?
      Parameters:
      organisation - not null
      license - not null
      Returns:
      true when resources should be rendered, false otherwise
    • isNot

      public boolean isNot(boolean claim)
      Negates claim.
      Parameters:
      claim - to be negated
      Returns:
      true when claim is false, false when true
    • sourceUrl

      public String sourceUrl(Resource resource)
      Renders the resource source URL based on configuration setting suitable for the license file.
      Parameters:
      resource - not null
      Returns:
      not null, possible empty string