info.magnolia.freemarker
Class FreemarkerConfig

java.lang.Object
  extended by info.magnolia.freemarker.FreemarkerConfig

public class FreemarkerConfig
extends Object

Observed bean holding Freemarker configuration. Not to be confused with Freemarker's own Configuration. This only exposes the few properties that Magnolia allows to configure and is able to handle properly. It also provides a few additional methods used internally.

See Also:
FreemarkerHelper, MagnoliaObjectWrapper, MagnoliaModelFactory

Constructor Summary
FreemarkerConfig()
           
 
Method Summary
 void addModelFactory(MagnoliaModelFactory modelFactory)
           
 void addSharedVariable(String name, Object value)
           
 void addTemplateLoader(freemarker.cache.TemplateLoader templateLoader)
           
static FreemarkerConfig getInstance()
          Deprecated. since 4.3 should not be needed - components using this can keep their instance
 List<MagnoliaModelFactory> getModelFactories()
           
 freemarker.template.ObjectWrapper getObjectWrapper()
           
 Map<String,freemarker.template.TemplateModel> getSharedVariables()
           
 freemarker.template.TemplateExceptionHandler getTemplateExceptionHandler()
           
 freemarker.cache.TemplateLoader getTemplateLoader()
           
 List<freemarker.cache.TemplateLoader> getTemplateLoaders()
           
protected  freemarker.template.ObjectWrapper newObjectWrapper()
           
 void setModelFactories(List<MagnoliaModelFactory> registeredModelFactories)
           
 void setSharedVariables(Map<String,freemarker.template.TemplateModel> sharedVariables)
           
 void setTemplateExceptionHandler(freemarker.template.TemplateExceptionHandler templateExceptionHandler)
           
 void setTemplateLoaders(List<freemarker.cache.TemplateLoader> templateLoaders)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreemarkerConfig

public FreemarkerConfig()
Method Detail

getInstance

public static FreemarkerConfig getInstance()
Deprecated. since 4.3 should not be needed - components using this can keep their instance


getObjectWrapper

public freemarker.template.ObjectWrapper getObjectWrapper()

newObjectWrapper

protected freemarker.template.ObjectWrapper newObjectWrapper()

getTemplateLoader

public freemarker.cache.TemplateLoader getTemplateLoader()

getModelFactories

public List<MagnoliaModelFactory> getModelFactories()

setModelFactories

public void setModelFactories(List<MagnoliaModelFactory> registeredModelFactories)

addModelFactory

public void addModelFactory(MagnoliaModelFactory modelFactory)

getTemplateLoaders

public List<freemarker.cache.TemplateLoader> getTemplateLoaders()

setTemplateLoaders

public void setTemplateLoaders(List<freemarker.cache.TemplateLoader> templateLoaders)

addTemplateLoader

public void addTemplateLoader(freemarker.cache.TemplateLoader templateLoader)

getSharedVariables

public Map<String,freemarker.template.TemplateModel> getSharedVariables()

setSharedVariables

public void setSharedVariables(Map<String,freemarker.template.TemplateModel> sharedVariables)

addSharedVariable

public void addSharedVariable(String name,
                              Object value)
                       throws freemarker.template.TemplateModelException
Throws:
freemarker.template.TemplateModelException

getTemplateExceptionHandler

public freemarker.template.TemplateExceptionHandler getTemplateExceptionHandler()

setTemplateExceptionHandler

public void setTemplateExceptionHandler(freemarker.template.TemplateExceptionHandler templateExceptionHandler)


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.