Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.google.sitebricks.compiler;
 
 
Compiles non-XML templates.

Author(s):
Dhanji R. Prasanna (dhanji@gmail com)
See also:
HtmlTemplateCompiler
public class FlatTemplateCompiler implements TemplateCompiler {
    private final SystemMetrics metrics;
    private final WidgetRegistry registry;
    @Inject
    public FlatTemplateCompiler(SystemMetrics metricsWidgetRegistry registry) {
        this. = metrics;
        this. = registry;
    }
    public Renderable compile(Class<?> pageTemplate template) {
      
        try {
            return .textWidget(template.getText(), new MvelEvaluatorCompiler(page));
        } catch (ExpressionCompileException e) {
            final List<CompileErrorerrors = Arrays.asList(
                    CompileError.in(template.getText())
                            .near(e.getError().getError().getLineNumber())
                            .causedBy(e)
            );
            final List<CompileErrorwarnings = Collections.emptyList();
            //log errors and abort compile
            .logErrorsAndWarnings(pageerrorswarnings);
            throw new TemplateCompileException(pagetemplate.getText(), errorswarnings);
        }
    }
New to GrepCode? Check out our FAQ X