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 theBeanFactory
of 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 Object
getModel(Item item, org.dom4j.Node node, String template)
Returns 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.
-
-
-
Method Detail
-
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
public Object getModel(Item item, org.dom4j.Node node, String template)
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
-
-