public void process(
            final TemplateModel template,
            final ITemplateContext context,
            final Writer writer) {

        Validate.isTrue(
                this.configuration == template.getConfiguration(),
                "Specified template was built by a different Template Engine instance");

        /*
         * Create the context instance that corresponds to this execution of the template engine
         */
        final IEngineContext engineContext =
                EngineContextManager.prepareEngineContext(this.configuration, template.getTemplateData(), context.getTemplateResolutionAttributes(), context);

        /*
         * Create the handler chain to process the data.
         *
         * In this case we are only processing an already existing model, which was created after some computation
         * at template-processing time. So this does not come directly from a template, and therefore pre-processors
         * should not be applied.
         *
         * As for post-processors, we know the result of this will not be directly written to output in most cases but
         * instead used to create a String that is afterwards inserted into the model as a Text node. In the only cases
         * in which this is not true is when this is used inside any kind of Lazy-processing CharSequence writer like
         * LazyProcessingCharSequence, and in such case we know those CharSequences are only used when there are
         * NO post-processors, so we are safe anyway.
         */
        final ProcessorTemplateHandler processorTemplateHandler = new ProcessorTemplateHandler();
        final ITemplateHandler processingHandlerChain =
                createTemplateProcessingHandlerChain(engineContext, false, false, processorTemplateHandler, writer);

        /*
         *  Process the template
         */
        template.process(processingHandlerChain);


        /*
         * Dispose the engine context now that processing has been done
         */
        EngineContextManager.disposeEngineContext(engineContext);

    }
public void process ( final TemplateModel template , final ITemplateContext context , final Writer writer ) { Validate . isTrue ( this . configuration == template . getConfiguration ( ) , "Specified template was built by a different Template Engine instance" ) ; final IEngineContext engineContext = EngineContextManager . prepareEngineContext ( this . configuration , template . getTemplateData ( ) , context . getTemplateResolutionAttributes ( ) , context ) ; final ProcessorTemplateHandler processorTemplateHandler = new ProcessorTemplateHandler ( ) ; final ITemplateHandler processingHandlerChain = createTemplateProcessingHandlerChain ( engineContext , false , false , processorTemplateHandler , writer ) ; template . process ( processingHandlerChain ) ; EngineContextManager . disposeEngineContext ( engineContext ) ; }
/*
---------------
PROCESS methods
---------------

Processing means executing a template that has already been parsed into a TemplateModel object