org.tinyjee.maven.dim.spi
Interface VelocityConfigurator

All Known Implementing Classes:
DefaultVelocityConfigurator

public interface VelocityConfigurator

VelocityConfigurator defines an interface that may be implemented and registered via service loading to customize the configuration of the velocity template engine and context before the templates are rendered.

Implementation:

 package my.package;
 public class MyVelocityConfigurator implements VelocityConfigurator {
      public void configureEngine(VelocityEngine engine) {
          engine.setProperty(VM_PERM_INLINE_LOCAL, true);
          ...
      }
      ...
 }
 

Register the implementation using service loading:

Since:
1.1
Version:
1.1
Author:
Juergen_Kellerer, 2011-10-14

Field Summary
static Iterable<VelocityConfigurator> CONFIGURATORS
          Is an iterable over all configurators within the classpath.
 
Method Summary
 void configureContext(Map<String,Object> requestParameters, Context templateContext)
          Is called right before a template is executed.
 void configureEngine(VelocityEngine engine)
          Is called after applying default settings but before the engine is initialized.
 void configureTools(EasyFactoryConfiguration toolsConfiguration)
          Is called when configuring velocity tools using EasyFactoryConfiguration.
 

Field Detail

CONFIGURATORS

static final Iterable<VelocityConfigurator> CONFIGURATORS
Is an iterable over all configurators within the classpath.

Method Detail

configureEngine

void configureEngine(VelocityEngine engine)
Is called after applying default settings but before the engine is initialized.

Parameters:
engine - an uninitialized engine that may be configured.

configureTools

void configureTools(EasyFactoryConfiguration toolsConfiguration)
Is called when configuring velocity tools using EasyFactoryConfiguration.

Parameters:
toolsConfiguration - the instance to use for configuring tools.

configureContext

void configureContext(Map<String,Object> requestParameters,
                      Context templateContext)
Is called right before a template is executed.

Parameters:
requestParameters - the macro request parameters as they would also be seen by the template.
templateContext - the pre-configured template context.