freemarker.testcase.models
Class TransformHashWrapper

java.lang.Object
  extended by freemarker.testcase.models.TransformHashWrapper
All Implemented Interfaces:
TemplateHashModel, TemplateModel, TemplateScalarModel

public final class TransformHashWrapper
extends java.lang.Object
implements TemplateHashModel, TemplateScalarModel

Part of the TestTransform testcase suite.

Version:
$Id: TransformHashWrapper.java 1054 2004-10-28 01:44:35Z run2000 $
Author:
Nicholas Cull

Constructor Summary
TransformHashWrapper()
          Creates new TransformHashWrapper
 
Method Summary
 TemplateModel get(java.lang.String key)
          Gets a TemplateModel from the hash.
 java.lang.String getAsString()
          Returns the scalar's value as a String.
 boolean isEmpty()
          Is the model empty?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformHashWrapper

public TransformHashWrapper()
Creates new TransformHashWrapper

Method Detail

get

public TemplateModel get(java.lang.String key)
                  throws TemplateModelException
Gets a TemplateModel from the hash.

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.
Throws:
TemplateModelException - there was a problem getting the value for the given key

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Is the model empty?

Specified by:
isEmpty in interface TemplateModel
Returns:
false to indicate the model is not empty
Throws:
TemplateModelException

getAsString

public java.lang.String getAsString()
                             throws TemplateModelException
Returns the scalar's value as a String.

Specified by:
getAsString in interface TemplateScalarModel
Returns:
the String value of this scalar.
Throws:
TemplateModelException