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
NodeTemplateModelFactory that always returns the BeanFactory of the Spring application context
where this factory is configured. Very useful in conjunction with the
SpELStringTemplateCompiler, 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 -
Method Summary
Modifier and TypeMethodDescriptionReturns always theBeanFactoryof the current Spring application context as the model.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Sets theBeanFactoryof the current Spring application context.
-
Constructor Details
-
BeanFactoryModelFactory
public BeanFactoryModelFactory()
-
-
Method Details
-
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
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
-