freemarker.ext.servlet
Class ServletContextHashModel
java.lang.Object
freemarker.ext.servlet.ServletContextHashModel
- All 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
Method Summary |
TemplateModel |
get(java.lang.String key)
Gets a TemplateModel from the hash. |
javax.servlet.GenericServlet |
getServlet()
Returns the underlying servlet. |
boolean |
isEmpty()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletContextHashModel
public ServletContextHashModel(javax.servlet.GenericServlet servlet,
ObjectWrapper wrapper)
ServletContextHashModel
public ServletContextHashModel(javax.servlet.ServletContext servletctx,
ObjectWrapper wrapper)
- Deprecated. use
ServletContextHashModel(GenericServlet, ObjectWrapper)
instead.
get
public TemplateModel get(java.lang.String key)
throws TemplateModelException
- Description copied from interface:
TemplateHashModel
- 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
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface TemplateHashModel
getServlet
public javax.servlet.GenericServlet getServlet()
- Returns the underlying servlet. Can return null if this object was
created using the deprecated constructor.