Class SpringTemplateLoader
java.lang.Object
org.springframework.ui.freemarker.SpringTemplateLoader
- All Implemented Interfaces:
freemarker.cache.TemplateLoader
FreeMarker
TemplateLoader
adapter that loads via a Spring ResourceLoader
.
Used by FreeMarkerConfigurationFactory
for any resource loader path that cannot
be resolved to a File
.- Since:
- 14.03.2004
- Author:
- Juergen Hoeller
- See Also:
-
FreeMarkerConfigurationFactory.setTemplateLoaderPath(java.lang.String)
Configuration.setDirectoryForTemplateLoading(java.io.File)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSpringTemplateLoader
(ResourceLoader resourceLoader, String templateLoaderPath) Create a new SpringTemplateLoader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeTemplateSource
(Object templateSource) findTemplateSource
(String name) long
getLastModified
(Object templateSource)
-
Field Details
-
logger
-
-
Constructor Details
-
SpringTemplateLoader
Create a new SpringTemplateLoader.- Parameters:
resourceLoader
- the Spring ResourceLoader to usetemplateLoaderPath
- the template loader path to use
-
-
Method Details
-
findTemplateSource
- Specified by:
findTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getReader
- Specified by:
getReader
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getLastModified
- Specified by:
getLastModified
in interfacefreemarker.cache.TemplateLoader
-
closeTemplateSource
- Specified by:
closeTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-