Class EntityObjectWrapper
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.templatemodel.EntityObjectWrapper
- All Implemented Interfaces:
TemplateObjectWrapper
TemplateObjectWrapper
for
Entity
s added to the template model. The TemplateModel
representation of the Entity
allows to retrieve field values and resolve
relations using the classic freemarker hash syntax: ${entity.relOther_entity.field}.-
Constructor Summary
ConstructorDescriptionEntityObjectWrapper
(Context context, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
freemarker.template.TemplateModel
wrap
(Object object, TemplateDefaultObjectWrapper defaultObjectWrapper)
-
Constructor Details
-
EntityObjectWrapper
public EntityObjectWrapper(Context context, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
useInDefaultObjectWrapper
public boolean useInDefaultObjectWrapper()- Specified by:
useInDefaultObjectWrapper
in interfaceTemplateObjectWrapper
-
wrap
public freemarker.template.TemplateModel wrap(Object object, TemplateDefaultObjectWrapper defaultObjectWrapper) throws freemarker.template.TemplateModelException - Specified by:
wrap
in interfaceTemplateObjectWrapper
- Throws:
freemarker.template.TemplateModelException
-
canWrap
- Specified by:
canWrap
in interfaceTemplateObjectWrapper
- Returns:
- true if this implementation can wrap the provided object
-