public TemplateContext(String template, Locale locale, String sourceName, ScopedMap model,
ModelAdaptor modelAdaptor, Engine engine, ErrorHandler errorHandler, ProcessListener processListener) {
this.model = model;
this.template = template;
this.locale = locale;
this.engine = engine;
this.scopes = new ArrayList<Token>();
this.sourceName = sourceName;
this.modelAdaptor = modelAdaptor;
this.errorHandler = errorHandler;
this.processListener = processListener;
this.output = new StringBuilder((int) ((template != null ? template.length() : 0) * engine.getExpansionSizeFactor()));
}