/** * <p> * Returns the engine context factory in effect. This factory is responsible for creating the * (internally-used) instances of {@link org.thymeleaf.context.IEngineContext} that will support * template processing. * </p> * <p> * By default, an instance of {@link org.thymeleaf.context.StandardEngineContextFactory} * is set. * </p> * * @return the cache manager */ public final IEngineContextFactory getEngineContextFactory() { if (this.initialized) { return this.configuration.getEngineContextFactory(); } return this.engineContextFactory; }
private static IEngineContext createEngineContextIfNeeded( final IEngineConfiguration configuration, final TemplateData templateData, final Map<String, Object> templateResolutionAttributes, final IContext context) { if (context instanceof IEngineContext) { // If this context is already an IEngineContext, we will not clone it return (IEngineContext) context; } // It's the engine context factory the one who has the responsibility of creating the specific // implementation of the engine context needed. final IEngineContextFactory engineContextFactory = configuration.getEngineContextFactory(); return engineContextFactory.createEngineContext( configuration, templateData, templateResolutionAttributes, context); }