Class DocumentModelAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.rendering.template.DocumentModelAdapter
-
- All Implemented Interfaces:
freemarker.template.AdapterTemplateModel,freemarker.template.TemplateHashModel,freemarker.template.TemplateHashModelEx,freemarker.template.TemplateModel
public class DocumentModelAdapter extends Object implements freemarker.template.TemplateHashModelEx, freemarker.template.AdapterTemplateModel
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModeldocprotected freemarker.template.ObjectWrapperwrapper
-
Constructor Summary
Constructors Constructor Description DocumentModelAdapter(DocumentModel doc)DocumentModelAdapter(DocumentModel doc, freemarker.template.ObjectWrapper wrapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description freemarker.template.TemplateModelget(String key)ObjectgetAdaptedObject(Class hint)booleanisEmpty()a doc model is never emptyfreemarker.template.TemplateCollectionModelkeys()intsize()freemarker.template.TemplateCollectionModelvalues()
-
-
-
Field Detail
-
doc
protected final DocumentModel doc
-
wrapper
protected final freemarker.template.ObjectWrapper wrapper
-
-
Constructor Detail
-
DocumentModelAdapter
public DocumentModelAdapter(DocumentModel doc, freemarker.template.ObjectWrapper wrapper)
-
DocumentModelAdapter
public DocumentModelAdapter(DocumentModel doc)
-
-
Method Detail
-
getAdaptedObject
public Object getAdaptedObject(Class hint)
- Specified by:
getAdaptedObjectin interfacefreemarker.template.AdapterTemplateModel
-
get
public freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
- Specified by:
getin interfacefreemarker.template.TemplateHashModel- Throws:
freemarker.template.TemplateModelException
-
isEmpty
public boolean isEmpty() throws freemarker.template.TemplateModelExceptiona doc model is never empty- Specified by:
isEmptyin interfacefreemarker.template.TemplateHashModel- Throws:
freemarker.template.TemplateModelException
-
keys
public freemarker.template.TemplateCollectionModel keys() throws freemarker.template.TemplateModelException- Specified by:
keysin interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
values
public freemarker.template.TemplateCollectionModel values() throws freemarker.template.TemplateModelException- Specified by:
valuesin interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
size
public int size() throws freemarker.template.TemplateModelException- Specified by:
sizein interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
-