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
-
Method Summary
Modifier and TypeMethodDescriptionReturns always theBeanFactory
of the current Spring application context as the model.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) Sets theBeanFactory
of the current Spring application context.
-
Constructor Details
-
BeanFactoryModelFactory
public BeanFactoryModelFactory()
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Sets theBeanFactory
of the current Spring application context.- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
getModel
Returns always theBeanFactory
of the current Spring application context as the model.- Specified by:
getModel
in interfaceNodeTemplateModelFactory
- Parameters:
item
- theItem
whose 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
-