Class SiteContextHashModel
java.lang.Object
org.craftercms.engine.util.freemarker.SiteContextHashModel
- All Implemented Interfaces:
freemarker.template.TemplateHashModel
,freemarker.template.TemplateHashModelEx
,freemarker.template.TemplateModel
Implementation of
TemplateHashModelEx
to safely expose the SiteContext
instance in templates- Since:
- 3.1.7
- Author:
- joseross
-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
-
Method Summary
-
Field Details
-
SITE_NAME_KEY
- See Also:
-
objectWrapper
protected freemarker.template.ObjectWrapper objectWrapper
-
-
Constructor Details
-
SiteContextHashModel
public SiteContextHashModel(freemarker.template.ObjectWrapper objectWrapper)
-
-
Method Details
-
size
public int size() throws freemarker.template.TemplateModelException- Specified by:
size
in interfacefreemarker.template.TemplateHashModelEx
- Throws:
freemarker.template.TemplateModelException
-
keys
public freemarker.template.TemplateCollectionModel keys() throws freemarker.template.TemplateModelException- Specified by:
keys
in interfacefreemarker.template.TemplateHashModelEx
- Throws:
freemarker.template.TemplateModelException
-
values
public freemarker.template.TemplateCollectionModel values() throws freemarker.template.TemplateModelException- Specified by:
values
in interfacefreemarker.template.TemplateHashModelEx
- Throws:
freemarker.template.TemplateModelException
-
get
public freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException - Specified by:
get
in interfacefreemarker.template.TemplateHashModel
- Throws:
freemarker.template.TemplateModelException
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacefreemarker.template.TemplateHashModel
-