Class PathBasedTemplateAvailabilityProvider
java.lang.Object
org.springframework.boot.autoconfigure.template.PathBasedTemplateAvailabilityProvider
- All Implemented Interfaces:
TemplateAvailabilityProvider
- Direct Known Subclasses:
FreeMarkerTemplateAvailabilityProvider
,GroovyTemplateAvailabilityProvider
public abstract class PathBasedTemplateAvailabilityProvider
extends Object
implements TemplateAvailabilityProvider
Abstract base class for
TemplateAvailabilityProvider
implementations that find
templates from paths.- Since:
- 1.4.6
- Author:
- Andy Wilkinson, Phillip Webb, Madhura Bhave
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Constructor Summary
ConstructorDescriptionPathBasedTemplateAvailabilityProvider
(String className, Class<? extends PathBasedTemplateAvailabilityProvider.TemplateAvailabilityProperties> propertiesClass, String propertyPrefix) -
Method Summary
Modifier and TypeMethodDescriptionboolean
isTemplateAvailable
(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) Returnstrue
if a template is available for the givenview
.
-
Constructor Details
-
PathBasedTemplateAvailabilityProvider
public PathBasedTemplateAvailabilityProvider(String className, Class<? extends PathBasedTemplateAvailabilityProvider.TemplateAvailabilityProperties> propertiesClass, String propertyPrefix)
-
-
Method Details
-
isTemplateAvailable
public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) Description copied from interface:TemplateAvailabilityProvider
Returnstrue
if a template is available for the givenview
.- Specified by:
isTemplateAvailable
in interfaceTemplateAvailabilityProvider
- Parameters:
view
- the view nameenvironment
- the environmentclassLoader
- the class loaderresourceLoader
- the resource loader- Returns:
- if the template is available
-