org.apache.tiles.autotag.generate
Class AbstractTemplateSuiteGenerator

Package class diagram package AbstractTemplateSuiteGenerator
java.lang.Object
  extended by org.apache.tiles.autotag.generate.AbstractTemplateSuiteGenerator
All Implemented Interfaces:
TemplateSuiteGenerator
Direct Known Subclasses:
FMModelRepositoryGenerator, TLDGenerator, VelocityPropertiesGenerator

public abstract class AbstractTemplateSuiteGenerator
extends Object
implements TemplateSuiteGenerator

A base template suite generator.

Version:
$Rev: 1044707 $ $Date: 2010-12-11 15:35:57 -0500 (Sat, 11 Dec 2010) $

Constructor Summary
AbstractTemplateSuiteGenerator(org.apache.velocity.app.VelocityEngine velocityEngine)
          Constructor.
 
Method Summary
 void generate(File directory, String packageName, TemplateSuite suite, Map<String,String> parameters)
          Generates the code.
protected abstract  String getDirectoryName(File directory, String packageName, TemplateSuite suite, Map<String,String> parameters)
          Calculates and returns the directory where the file will be written..
protected abstract  String getFilename(File directory, String packageName, TemplateSuite suite, Map<String,String> parameters)
          Calculates and returns the filename of the generated file.
protected abstract  String getTemplatePath(File directory, String packageName, TemplateSuite suite, Map<String,String> parameters)
          Calculates and returns the template path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTemplateSuiteGenerator

public AbstractTemplateSuiteGenerator(org.apache.velocity.app.VelocityEngine velocityEngine)
Constructor.

Parameters:
velocityEngine - The Velocity engine.
Method Detail

generate

public void generate(File directory,
                     String packageName,
                     TemplateSuite suite,
                     Map<String,String> parameters)
Description copied from interface: TemplateSuiteGenerator
Generates the code.

Specified by:
generate in interface TemplateSuiteGenerator
Parameters:
directory - The base directory where the code will be put.
packageName - The package name.
suite - The template suite.
parameters - Configuration parameters.

getTemplatePath

protected abstract String getTemplatePath(File directory,
                                          String packageName,
                                          TemplateSuite suite,
                                          Map<String,String> parameters)
Calculates and returns the template path.

Parameters:
directory - The directory where the file will be written.
packageName - The name of the package.
suite - The template suite.
parameters - The map of parameters.
Returns:
The template path.

getFilename

protected abstract String getFilename(File directory,
                                      String packageName,
                                      TemplateSuite suite,
                                      Map<String,String> parameters)
Calculates and returns the filename of the generated file.

Parameters:
directory - The directory where the file will be written.
packageName - The name of the package.
suite - The template suite.
parameters - The map of parameters.
Returns:
The template path.

getDirectoryName

protected abstract String getDirectoryName(File directory,
                                           String packageName,
                                           TemplateSuite suite,
                                           Map<String,String> parameters)
Calculates and returns the directory where the file will be written..

Parameters:
directory - The directory where the file will be written.
packageName - The name of the package.
suite - The template suite.
parameters - The map of parameters.
Returns:
The template path.


Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.