Package freemarker.cache
Class MergingTemplateConfigurationFactory
java.lang.Object
freemarker.cache.TemplateConfigurationFactory
freemarker.cache.MergingTemplateConfigurationFactory
Returns the merged results of all the child factories. The factories are merged in the order as they were added.
null results from the child factories will be ignored. If all child factories return null, the result
of this factory will be null too.- Since:
- 2.3.24
-
Constructor Summary
ConstructorsConstructorDescriptionMergingTemplateConfigurationFactory(TemplateConfigurationFactory... templateConfigurationFactories) -
Method Summary
Modifier and TypeMethodDescriptionReturns (maybe creates) theTemplateConfigurationfor the given template source.protected voidCallsTemplateConfiguration.setParentConfiguration(Configuration)on each enclosedTemplateConfigurationandTemplateConfigurationFactory.setConfiguration(Configuration)on each enclosedTemplateConfigurationFactoryobjects.Methods inherited from class freemarker.cache.TemplateConfigurationFactory
getConfiguration, setConfiguration
-
Constructor Details
-
MergingTemplateConfigurationFactory
public MergingTemplateConfigurationFactory(TemplateConfigurationFactory... templateConfigurationFactories)
-
-
Method Details
-
get
public TemplateConfiguration get(String sourceName, Object templateSource) throws IOException, TemplateConfigurationFactoryExceptionDescription copied from class:TemplateConfigurationFactoryReturns (maybe creates) theTemplateConfigurationfor the given template source.- Specified by:
getin classTemplateConfigurationFactory- Parameters:
sourceName- The name (path) that was used forTemplateLoader.findTemplateSource(String). SeeTemplate.getSourceName()for details.templateSource- The object returned byTemplateLoader.findTemplateSource(String).- Returns:
- The
TemplateConfigurationto apply, ornullif the there's noTemplateConfigurationfor this template source. - Throws:
IOException- Typically, if there factory needs further I/O to find out more about the template source, but that fails.TemplateConfigurationFactoryException- If there's a problem that's specific to the factory logic.
-
setConfigurationOfChildren
Description copied from class:TemplateConfigurationFactoryCallsTemplateConfiguration.setParentConfiguration(Configuration)on each enclosedTemplateConfigurationandTemplateConfigurationFactory.setConfiguration(Configuration)on each enclosedTemplateConfigurationFactoryobjects. It only supposed to call these on the direct "children" of this object, not on the children of the children.- Specified by:
setConfigurationOfChildrenin classTemplateConfigurationFactory
-