com.atlassian.jira.template.velocity
Class VelocityTemplateCache

java.lang.Object
  extended by com.atlassian.jira.template.velocity.VelocityTemplateCache
All Implemented Interfaces:
Startable

public class VelocityTemplateCache
extends Object
implements Startable

Caches per-template information so that we only calculate it at most once.

Since:
v5.1

Constructor Summary
VelocityTemplateCache()
          Creates a new VelocityDirectiveCache backed by a DefaultDirectiveChecker.
VelocityTemplateCache(com.atlassian.velocity.htmlsafe.directive.DirectiveChecker directiveChecker)
          Creates a new VelocityDirectiveCache backed by the supplied DirectiveChecker.
 
Method Summary
 boolean isDirectivePresent(String directiveName, org.apache.velocity.Template template)
          Determines whether a directive with a specified name is present on a template instance.
 void onClearCaches(ClearCacheEvent clearCacheEvent)
          Clears the cache upon receiving a ClearCacheEvent.
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityTemplateCache

public VelocityTemplateCache()
Creates a new VelocityDirectiveCache backed by a DefaultDirectiveChecker.


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 Detail

start

public void start()
           throws Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
Exception - Allows implementations to throw an Exception.

onClearCaches

@EventListener
public void onClearCaches(ClearCacheEvent clearCacheEvent)
Clears the cache upon receiving a ClearCacheEvent.

Parameters:
clearCacheEvent - a ClearCacheEvent

isDirectivePresent

public boolean isDirectivePresent(String directiveName,
                                  org.apache.velocity.Template template)
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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.