freemarker.ext.beans
Class StaticModels

java.lang.Object
  |
  +--freemarker.ext.beans.StaticModels
All Implemented Interfaces:
TemplateHashModel, TemplateModel

public final class StaticModels
extends java.lang.Object
implements TemplateHashModel

Utility class for instantiating StaticModel instances from templates. If your template's data model contains an instance of StaticModels (named, say StaticModels), then you can instantiate an arbitrary StaticModel using get syntax (i.e. StaticModels["java.lang.System"].currentTimeMillis()).

Version:
1.0
Author:
Attila Szegedi, szegedia@freemail.hu

Field Summary
static StaticModels INSTANCE
          The single instance of the class.
 
Method Summary
 TemplateModel get(java.lang.String key)
          Returns a StaticModel for the fully qualified class name passed as the key.
 boolean isEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StaticModels INSTANCE
The single instance of the class.
Method Detail

get

public TemplateModel get(java.lang.String key)
                  throws TemplateModelException
Returns a StaticModel for the fully qualified class name passed as the key.
Specified by:
get in interface TemplateHashModel
Following copied from interface: freemarker.template.TemplateHashModel
Parameters:
key - the name by which the TemplateModel is identified in the template.
Returns:
the TemplateModel referred to by the key, or null if not found.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface TemplateModel
Following copied from interface: freemarker.template.TemplateModel
Returns:
true if this object is empty.