TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = null; try { tm = exp.getAsTemplateModel(env); } catch (InvalidReferenceException ire) { if (!(exp instanceof ParentheticalExpression)) { throw ire; } } return tm == null ? TemplateBooleanModel.FALSE : TemplateBooleanModel.TRUE; }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateHashModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateSequenceModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateSequenceModel || tm instanceof TemplateCollectionModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateTransformModel || tm instanceof Macro || tm instanceof TemplateDirectiveModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof Macro) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateTransformModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateHashModelEx) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateSequenceModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateScalarModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); assertNonNull(tm, target, env); return (tm instanceof TemplateBooleanModel) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE; } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel tm = target.getAsTemplateModel(env); if (!(tm instanceof Macro)) { invalidTypeException(tm, target, env, "macro"); } return env.getMacroNamespace((Macro) tm); } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (!(model instanceof TemplateSequenceModel)) { throw invalidTypeException(model, target, env, "sequence"); } return calculateResult((TemplateSequenceModel) model); } abstract TemplateModel calculateResult(TemplateSequenceModel tsm)
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (model instanceof TemplateScalarModel) { return new BIMethod(((TemplateScalarModel) model).getAsString()); } throw invalidTypeException(model, target, env, "string"); }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (model instanceof TemplateScalarModel) { return new ReplaceMethod(((TemplateScalarModel) model).getAsString()); } throw invalidTypeException(model, target, env, "string"); } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (model instanceof TemplateScalarModel) { return new BIMethod(((TemplateScalarModel) model).getAsString()); } throw invalidTypeException(model, target, env, "string"); }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (model instanceof TemplateScalarModel) { return new BIMethod(((TemplateScalarModel) model).getAsString()); } throw invalidTypeException(model, target, env, "string"); }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel model = target.getAsTemplateModel(env); if (model instanceof TemplateScalarModel) { return new BIMethod(((TemplateScalarModel) model).getAsString()); } throw invalidTypeException(model, target, env, "string"); }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel targetModel = target.getAsTemplateModel(env); assertNonNull(targetModel, this, env); if (!(targetModel instanceof TemplateScalarModel)) { throw invalidTypeException(targetModel, target, env, "string"); } return new MatcherBuilder((TemplateScalarModel) targetModel); } }
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException { TemplateModel targetModel = target.getAsTemplateModel(env); assertNonNull(targetModel, this, env); if (targetModel instanceof RegexMatchModel) { return ((RegexMatchModel) targetModel).getGroups(); } if (targetModel instanceof RegexMatchModel.Match) { return ((RegexMatchModel.Match) targetModel).subs; } throw invalidTypeException(targetModel, target, env, "a regular expression matcher"); } }