public Object eval(TemplateRuntime runtime, TemplateOutputStream appender, Object ctx, VariableResolverFactory factory) { String file = MVEL.executeExpression(cIncludeExpression, ctx, factory, String.class); if (this.cPreExpression != null) { MVEL.executeExpression(cPreExpression, ctx, factory); } if (next != null) { return next.eval(runtime, appender.append(String.valueOf(TemplateRuntime.eval(readFile(runtime, file, ctx, factory), ctx, factory))), ctx, factory); } else { return appender.append(String.valueOf(MVEL.eval(readFile(runtime, file, ctx, factory), ctx, factory))); } }
private String readFile(String fileName, Object ctx, VariableResolverFactory factory) { File file = getFile(fileName); if (fileDateStamp == 0 || fileDateStamp != file.lastModified()) { fileDateStamp = file.lastModified(); cFileCache = TemplateCompiler.compileTemplate(readInFile(file)); } return String.valueOf(TemplateRuntime.execute(cFileCache, ctx, factory)); }
public static File getFile(String fileName) { return new File(String.valueOf(peek()) + "/" + fileName); }
codeCache ? new CompiledIncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1, parserContext) : new IncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1); break;
private String readFile(TemplateRuntime runtime, String fileName, Object ctx, VariableResolverFactory factory) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); if (fileDateStamp == 0 || fileDateStamp != file.lastModified()) { fileDateStamp = file.lastModified(); cFileCache = TemplateCompiler.compileTemplate(readInFile(runtime, file), context); } return String.valueOf(TemplateRuntime.execute(cFileCache, ctx, factory)); }
instream = openInputStream(file); runtime.getRelPath().push(file.getParent());
codeCache ? new CompiledIncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1) : new IncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1); break;
private String readFile(TemplateRuntime runtime, String fileName, Object ctx, VariableResolverFactory factory) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); if (fileDateStamp == 0 || fileDateStamp != file.lastModified()) { fileDateStamp = file.lastModified(); cFileCache = TemplateCompiler.compileTemplate(readInFile(runtime, file), context); } return String.valueOf(TemplateRuntime.execute(cFileCache, ctx, factory)); }
instream = openInputStream(file); runtime.getRelPath().push(file.getParent());
public Object eval(TemplateRuntime runtime, TemplateOutputStream appender, Object ctx, VariableResolverFactory factory) { String file = MVEL.executeExpression(cIncludeExpression, ctx, factory, String.class); if (this.cPreExpression != null) { MVEL.executeExpression(cPreExpression, ctx, factory); } if (next != null) { return next.eval(runtime, appender.append(String.valueOf(TemplateRuntime.eval(readFile(runtime, file, ctx, factory), ctx, factory))), ctx, factory); } else { return appender.append(String.valueOf(MVEL.eval(readFile(runtime, file, ctx, factory), ctx, factory))); } }
codeCache ? new CompiledIncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1, parserContext) : new IncludeNode(start, name, template, captureOrbInternal(), start = cursor + 1); break;
public Object eval(TemplateRuntime runtime, TemplateOutputStream appender, Object ctx, VariableResolverFactory factory) { String file = MVEL.executeExpression(cIncludeExpression, ctx, factory, String.class); if (this.cPreExpression != null) { MVEL.executeExpression(cPreExpression, ctx, factory); } if (next != null) { return next.eval(runtime, appender.append(String.valueOf(TemplateRuntime.eval(readFile(file, ctx, factory), ctx, factory))), ctx, factory); } else { return appender.append(String.valueOf(MVEL.eval(readFile(file, ctx, factory), ctx, factory))); } }