freemarker.ext.servlet

Class ServletContextHashModel

Implemented Interfaces:
TemplateHashModel, TemplateModel

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

TemplateHashModel wrapper for a ServletContext attributes.
Version:
$Id: ServletContextHashModel.java,v 1.12 2003/01/12 23:40:14 revusky Exp $
Author:
Attila Szegedi

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Constructor Summary

ServletContextHashModel(GenericServlet servlet, ObjectWrapper wrapper)
ServletContextHashModel(ServletContext servletctx, ObjectWrapper wrapper)
Deprecated. use ServletContextHashModel(GenericServlet,ObjectWrapper) instead.

Method Summary

TemplateModel
get(String key)
Gets a TemplateModel from the hash.
GenericServlet
getServlet()
Returns the underlying servlet.
boolean
isEmpty()

Constructor Details

ServletContextHashModel

public ServletContextHashModel(GenericServlet servlet,
                               ObjectWrapper wrapper)

ServletContextHashModel

public ServletContextHashModel(ServletContext servletctx,
                               ObjectWrapper wrapper)

Deprecated. use ServletContextHashModel(GenericServlet,ObjectWrapper) instead.

Method Details

get

public TemplateModel get(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.

getServlet

public GenericServlet getServlet()
Returns the underlying servlet. Can return null if this object was created using the deprecated constructor.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface TemplateHashModel