Search in sources :

Example 1 with TemplateClassCode

use of jetbrick.template.parser.code.TemplateClassCode in project jetbrick-template-1x by subchen.

the class JetTemplateCodeVisitor method visitTemplate.

@Override
public Code visitTemplate(TemplateContext ctx) {
    tcc = new TemplateClassCode();
    tcc.setPackageName(resource.getPackageName());
    tcc.setClassName(resource.getClassName());
    tcc.setTemplateName(resource.getName());
    tcc.setEncoding(engine.getConfig().getOutputEncoding());
    scopeCode = tcc.getMethodCode();
    scopeCode.define(Code.CONTEXT_NAME, TypedKlass.JetContext);
    scopeCode.setBodyCode(ctx.block().accept(this));
    return tcc;
}
Also used : TemplateClassCode(jetbrick.template.parser.code.TemplateClassCode)

Aggregations

TemplateClassCode (jetbrick.template.parser.code.TemplateClassCode)1