Package 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.
-
-
Field Summary
-
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
-
Constructor Summary
Constructors Constructor Description ServletContextHashModel(javax.servlet.GenericServlet servlet, ObjectWrapper wrapper)ServletContextHashModel(javax.servlet.ServletContext servletctx, ObjectWrapper wrapper)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateModelget(java.lang.String key)Gets a TemplateModel from the hash.javax.servlet.GenericServletgetServlet()Returns the underlying servlet.booleanisEmpty()
-
-
-
Constructor Detail
-
ServletContextHashModel
public ServletContextHashModel(javax.servlet.GenericServlet servlet, ObjectWrapper wrapper)
-
ServletContextHashModel
@Deprecated public ServletContextHashModel(javax.servlet.ServletContext servletctx, ObjectWrapper wrapper)Deprecated.
-
-
Method Detail
-
get
public TemplateModel get(java.lang.String key) throws TemplateModelException
Description copied from interface:TemplateHashModelGets a TemplateModel from the hash.- Specified by:
getin interfaceTemplateHashModel- 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:
isEmptyin interfaceTemplateHashModel
-
getServlet
public javax.servlet.GenericServlet getServlet()
Returns the underlying servlet. Can return null if this object was created using the deprecated constructor.
-
-