org.bejug.javacareers.common.templates
Class TemplateUtilities

java.lang.Object
  extended byorg.bejug.javacareers.common.templates.TemplateUtilities

public class TemplateUtilities
extends java.lang.Object

Version:
$Revision: 1.16 $ - $Date: 2005/12/20 15:36:46 $
Author:
bbr (last modified by $Author: shally $)

Constructor Summary
TemplateUtilities()
          default constructor.
 
Method Summary
 java.util.List getAllTemplates()
          gets all the templates available.
 java.util.List getAllTemplatesByLanguage(java.lang.String language)
          gets all templates that are written for a certain language
 java.util.List getAllTemplatesByName(java.lang.String template)
          loads all templates by name.
 TemplateHolder getTemplate(java.lang.String template)
          gets a template by name.
 TemplateHolder getTemplate(java.lang.String template, java.lang.String locale)
          gets a template based on the name and locale of the template.
 org.apache.velocity.app.VelocityEngine getVelocityEngine()
           
 void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateUtilities

public TemplateUtilities()
default constructor.

Method Detail

getTemplate

public TemplateHolder getTemplate(java.lang.String template)
gets a template by name.

Parameters:
template - a String indicating the name of the template.
Returns:
a TemplateHolder holding the wanted Template.

getTemplate

public TemplateHolder getTemplate(java.lang.String template,
                                  java.lang.String locale)
gets a template based on the name and locale of the template.

Parameters:
template - the name of the template to match.
locale - the locale to match
Returns:
the TemplateHolder matching the given criteria.

getAllTemplates

public java.util.List getAllTemplates()
gets all the templates available.

Returns:
a List containing all velocity templates.

getAllTemplatesByLanguage

public java.util.List getAllTemplatesByLanguage(java.lang.String language)
gets all templates that are written for a certain language

Parameters:
language - the language to match.
Returns:
a List containing all templates for a certain language.

getAllTemplatesByName

public java.util.List getAllTemplatesByName(java.lang.String template)
loads all templates by name.

Parameters:
template - the name of the template.
Returns:
a List of templates who's names start with template.

getVelocityEngine

public org.apache.velocity.app.VelocityEngine getVelocityEngine()
Returns:
the wanted VelocityEngine.

setVelocityEngine

public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
Parameters:
velocityEngine - the engine to set.


Copyright © 2005-2006 BeJUG. All Rights Reserved.