Class BeanFactoryModelFactory
- java.lang.Object
-
- org.craftercms.core.processors.impl.template.BeanFactoryModelFactory
-
- All Implemented Interfaces:
NodeTemplateModelFactory,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware
public class BeanFactoryModelFactory extends Object implements NodeTemplateModelFactory, org.springframework.beans.factory.BeanFactoryAware
NodeTemplateModelFactorythat always returns theBeanFactoryof the Spring application context where this factory is configured. Very useful in conjunction with theSpELStringTemplateCompiler, since you can use SpEL in the node template just as you would use SpEl in a Spring XML configuration file.- Author:
- Alfonso Vásquez
-
-
Constructor Summary
Constructors Constructor Description BeanFactoryModelFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetModel(Item item, org.dom4j.Node node, String template)Returns always theBeanFactoryof the current Spring application context as the model.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)Sets theBeanFactoryof the current Spring application context.
-
-
-
Method Detail
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Sets theBeanFactoryof the current Spring application context.- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware
-
getModel
public Object getModel(Item item, org.dom4j.Node node, String template)
Returns always theBeanFactoryof the current Spring application context as the model.- Specified by:
getModelin interfaceNodeTemplateModelFactory- Parameters:
item- theItemwhose descriptor contains the specified nodenode- the DOM node whose content is the specified templatetemplate- the actual template- Returns:
- the model to be used for processing the specified template
-
-