Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

freemarker.testcase.models
Class MultiModel1  view MultiModel1 download MultiModel1.java

java.lang.Object
  extended byfreemarker.testcase.models.MultiModel1
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateModel, freemarker.template.TemplateScalarModel, freemarker.template.TemplateSequenceModel

public class MultiModel1
extends java.lang.Object
implements freemarker.template.TemplateHashModel, freemarker.template.TemplateSequenceModel, freemarker.template.TemplateScalarModel

Testcase to see how FreeMarker deals with multiple Template models.

Version:
$Id: MultiModel1.java,v 1.17 2004/01/06 17:06:44 szegedia Exp $

Field Summary
private  freemarker.template.TemplateHashModel m_cHashModel
           
private  freemarker.template.TemplateModel m_cListHashModel1
           
private  freemarker.template.TemplateModel m_cListHashModel2
           
private  freemarker.template.TemplateSequenceModel m_cListModel
           
private  freemarker.template.TemplateModel m_cSubModel
           
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Fields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING
 
Constructor Summary
MultiModel1()
          Creates new MultiModel1
 
Method Summary
 freemarker.template.TemplateModel get(int i)
          Retrieves the i-th template model in this sequence.
 freemarker.template.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()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cSubModel

private freemarker.template.TemplateModel m_cSubModel

m_cListHashModel1

private freemarker.template.TemplateModel m_cListHashModel1

m_cListHashModel2

private freemarker.template.TemplateModel m_cListHashModel2

m_cListModel

private freemarker.template.TemplateSequenceModel m_cListModel

m_cHashModel

private freemarker.template.TemplateHashModel m_cHashModel
Constructor Detail

MultiModel1

public MultiModel1()
Creates new MultiModel1

Method Detail

get

public freemarker.template.TemplateModel get(java.lang.String key)
Gets a TemplateModel from the hash.

Specified by:
get in interface freemarker.template.TemplateHashModel

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface freemarker.template.TemplateHashModel

get

public freemarker.template.TemplateModel get(int i)
                                      throws freemarker.template.TemplateModelException
Description copied from interface: freemarker.template.TemplateSequenceModel
Retrieves the i-th template model in this sequence.

Specified by:
get in interface freemarker.template.TemplateSequenceModel

getAsString

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

Specified by:
getAsString in interface freemarker.template.TemplateScalarModel

size

public int size()
         throws freemarker.template.TemplateModelException
Specified by:
size in interface freemarker.template.TemplateSequenceModel