public TemplateModel get(Environment env, BuiltInExpression caller,
TemplateModel model)
throws TemplateException {
String id = null, interpretString = null;
if (model instanceof TemplateSequenceModel) {
TemplateSequenceModel tsm = (TemplateSequenceModel) model;
TemplateModel tm = tsm.get(1);
if (tm != null) {
if(tm instanceof TemplateScalarModel) {
id = ((TemplateScalarModel) tm).getAsString();
}
else {
throw new TemplateModelException("Expecting string as second item of sequence of left of ?interpret built-in");
}
}
tm = tsm.get(0);
if (!(tm instanceof TemplateScalarModel)) {
throw new TemplateModelException("Expecting string as first item of sequence of left of ?interpret built-in");
}
interpretString = ((TemplateScalarModel) tm).getAsString();
}