Class RenderingHelper

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

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

    Constructors
    Constructor
    Description
    RenderingHelper(org.apache.creadur.whisker.model.Descriptor work, org.apache.creadur.whisker.app.Configuration configuration)
    Constructs a helper for the given work and configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isNot(boolean claim)
    Negates claim.
    boolean
    renderResources(org.apache.creadur.whisker.model.ByOrganisation organisation, org.apache.creadur.whisker.model.WithLicense license)
    Should resources with the given license by the given organisation be rendered?
    sourceUrl(org.apache.creadur.whisker.model.Resource resource)
    Renders the resource source URL based on configuration setting suitable for the license file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RenderingHelper

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

    • renderResources

      public boolean renderResources(org.apache.creadur.whisker.model.ByOrganisation organisation, org.apache.creadur.whisker.model.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(org.apache.creadur.whisker.model.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