Class RenderingHelper
java.lang.Object
org.apache.creadur.whisker.out.velocity.RenderingHelper
Factors out rendering logic from template.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderingHelper(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 TypeMethodDescriptionbooleanisNot(boolean claim) Negates claim.booleanrenderResources(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.
-
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 nullconfiguration- 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 nulllicense- 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
Renders the resource source URL based on configuration setting suitable for the license file.- Parameters:
resource- not null- Returns:
- not null, possible empty string
-