throw new ScriptRuntimeException("Template param must be a Map.", paramsExpr);
}
} else {
params = KeyValuesUtil.EMPTY_KEY_VALUES;
}
final Template preTemplate = context.template;
final KeyValues preRootParams = context.rootParams;
final Object[] preVars = context.vars;
final VariantIndexer[] preIndexers = context.indexers;
final int preIndexer = context.indexer;
try {
Template template = engine.getTemplate(myTemplateName, String.valueOf(templateName));
context.template = template;
context.rootParams = engine.isShareRootData() ? KeyValuesUtil.wrap(preRootParams, params) : params;
template.merge(context, params);
if (export) {
Map<String, Object> result = new HashMap<String, Object>();
context.exportTo(result);
return result;
}