freemarker.ext.beans
Class RootMapModel

java.lang.Object
  extended by freemarker.ext.beans.RootMapModel
All Implemented Interfaces:
TemplateHashModel, TemplateModel, TemplateModelRoot, TemplateWriteableHashModel, java.io.Serializable

Deprecated. this class is deprecated in favour of the classes in the freemarker.ext.beans2 package

public class RootMapModel
extends java.lang.Object
implements TemplateModelRoot, java.io.Serializable

A wrapper for an arbitrary map that will expose it as a TemplateModelRoot. All values returned from the get(java.lang.String) method are automatically passed through BeansWrapper.wrap(java.lang.Object).

Version:
$Id: RootMapModel.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Attila Szegedi, Scriptum Inc.
See Also:
Serialized Form

Constructor Summary
RootMapModel()
          Deprecated. Creates a new model with its own internal map.
RootMapModel(java.util.Map<java.lang.String,TemplateModel> map)
          Deprecated. Creates a new model that adds TemplateModelRoot behavior to the passed map.
 
Method Summary
 TemplateModel get(java.lang.String key)
          Deprecated. Returns BeansWrapper.wrap(map.get(key)) where map is the underlying Map.
 boolean isEmpty()
          Deprecated. Returns map.isEmpty() where map is the underlying map.
 void put(java.lang.String key, TemplateModel model)
          Deprecated. Puts the specified template model into the map.
 void remove(java.lang.String key)
          Deprecated. Removes the template model with the specified key from the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootMapModel

public RootMapModel()
Deprecated. 
Creates a new model with its own internal map.


RootMapModel

public RootMapModel(java.util.Map<java.lang.String,TemplateModel> map)
Deprecated. 
Creates a new model that adds TemplateModelRoot behavior to the passed map.

Method Detail

isEmpty

public boolean isEmpty()
Deprecated. 
Returns map.isEmpty() where map is the underlying map.

Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty, otherwise false

get

public TemplateModel get(java.lang.String key)
Deprecated. 
Returns BeansWrapper.wrap(map.get(key)) where map is the underlying Map.

Specified by:
get in interface 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.

put

public void put(java.lang.String key,
                TemplateModel model)
Deprecated. 
Puts the specified template model into the map.

Specified by:
put in interface TemplateModelRoot
Specified by:
put in interface TemplateWriteableHashModel
Parameters:
key - the hash key.
model - the hash value to be added.

remove

public void remove(java.lang.String key)
Deprecated. 
Removes the template model with the specified key from the map.

Specified by:
remove in interface TemplateModelRoot
Parameters:
key - the key to be removed.