Class SiteContextHashModel
- java.lang.Object
-
- org.craftercms.engine.util.freemarker.SiteContextHashModel
-
- All Implemented Interfaces:
freemarker.template.TemplateHashModel
,freemarker.template.TemplateHashModelEx
,freemarker.template.TemplateModel
public class SiteContextHashModel extends Object implements freemarker.template.TemplateHashModelEx
Implementation ofTemplateHashModelEx
to safely expose theSiteContext
instance in templates- Since:
- 3.1.7
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected freemarker.template.ObjectWrapper
objectWrapper
static String
SITE_NAME_KEY
-
Constructor Summary
Constructors Constructor Description SiteContextHashModel(freemarker.template.ObjectWrapper objectWrapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description freemarker.template.TemplateModel
get(String key)
boolean
isEmpty()
freemarker.template.TemplateCollectionModel
keys()
int
size()
freemarker.template.TemplateCollectionModel
values()
-
-
-
Field Detail
-
SITE_NAME_KEY
public static final String SITE_NAME_KEY
- See Also:
- Constant Field Values
-
objectWrapper
protected freemarker.template.ObjectWrapper objectWrapper
-
-
Method Detail
-
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
-
-