freemarker.ext.misc
Class ExtendedHash

java.lang.Object
  |
  +--freemarker.template.SimpleHash
        |
        +--freemarker.ext.misc.ExtendedHash
All Implemented Interfaces:
java.io.Serializable, TemplateHashModel, TemplateModel, TemplateModelRoot, TemplateObjectModel

public class ExtendedHash
extends SimpleHash
implements java.io.Serializable

Simple extension to the SimpleHash implementation. This class implements a number of convenience facilities in the form of template hash keys. The hash keys are:

Since:
1.7
Version:
$Id: ExtendedHash.java,v 1.7 2003/11/16 05:00:07 run2000 Exp $
See Also:
ExtendedList, Serialized Form

Fields inherited from class freemarker.template.SimpleHash
hash
 
Constructor Summary
ExtendedHash()
          Creates new ExtendedHash.
ExtendedHash(java.util.Map hash)
          Creates new ExtendedHash given a backing Map.
 
Method Summary
 TemplateModel get(java.lang.String key)
          Gets a TemplateModel from the hash.
 
Methods inherited from class freemarker.template.SimpleHash
equals, getAsObject, hashCode, isEmpty, put, put, put, put, put, remove, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedHash

public ExtendedHash()
Creates new ExtendedHash.

ExtendedHash

public ExtendedHash(java.util.Map hash)
Creates new ExtendedHash given a backing Map.
Method Detail

get

public TemplateModel get(java.lang.String key)
                  throws TemplateModelException
Gets a TemplateModel from the hash. If the key matches one of the special values used in this implementation, return the special value, otherwise return the value from the underlying Map.
Overrides:
get in class SimpleHash
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.