use of freemarker.template.TemplateModelAdapter in project freemarker by apache.
the class ModelCache method getInstance.
public TemplateModel getInstance(Object object) {
if (object instanceof TemplateModel) {
return (TemplateModel) object;
}
if (object instanceof TemplateModelAdapter) {
return ((TemplateModelAdapter) object).getTemplateModel();
}
if (useCache && isCacheable(object)) {
TemplateModel model = lookup(object);
if (model == null) {
model = create(object);
register(model, object);
}
return model;
} else {
return create(object);
}
}
Aggregations