Class VelocityTemplateCache
java.lang.Object
com.atlassian.jira.template.velocity.VelocityTemplateCache
- All Implemented Interfaces:
Startable
Caches per-template information so that we only calculate it at most once.
- Since:
- v5.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new VelocityDirectiveCache backed by aDefaultDirectiveChecker.VelocityTemplateCache(com.atlassian.velocity.htmlsafe.directive.DirectiveChecker directiveChecker) Creates a new VelocityDirectiveCache backed by the supplied DirectiveChecker. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDirectivePresent(String directiveName, org.apache.velocity.Template template) Determines whether a directive with a specified name is present on a template instance.voidonClearCaches(ClearCacheEvent clearCacheEvent) Clears the cache upon receiving a ClearCacheEvent.voidstart()This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-
Constructor Details
-
VelocityTemplateCache
public VelocityTemplateCache()Creates a new VelocityDirectiveCache backed by aDefaultDirectiveChecker. -
VelocityTemplateCache
public VelocityTemplateCache(com.atlassian.velocity.htmlsafe.directive.DirectiveChecker directiveChecker) Creates a new VelocityDirectiveCache backed by the supplied DirectiveChecker.- Parameters:
directiveChecker- the DirectiveChecker to use
-
-
Method Details
-
start
Description copied from interface:StartableThis method will be called after the plugin system is fully initialised and all components added to the dependency injection framework. -
onClearCaches
Clears the cache upon receiving a ClearCacheEvent.- Parameters:
clearCacheEvent- a ClearCacheEvent
-
isDirectivePresent
Determines whether a directive with a specified name is present on a template instance.- Parameters:
directiveName- The name of the directive to look for.template- The template where we will search for the directive.- Returns:
- true, if the directive has been defined on the template; otherwise, false.
-