Class RenderingHelper
java.lang.Object
org.apache.creadur.whisker.out.velocity.RenderingHelper
Factors out rendering logic from template.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderingHelper
(Descriptor work, Configuration configuration) Constructs a helper for the given work and configuration. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isNot
(boolean claim) Negates claim.boolean
renderResources
(ByOrganisation organisation, WithLicense license) Should resources with the given license by the given organisation be rendered?Renders the resource source URL based on configuration setting suitable for the license file.
-
Constructor Details
-
RenderingHelper
Constructs a helper for the given work and configuration.- Parameters:
work
- not nullconfiguration
- not null
-
-
Method Details
-
renderResources
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
-