Class TemplateAvailabilityProviders
java.lang.Object
org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders
Collection of
TemplateAvailabilityProvider beans that can be used to check
which (if any) templating engine supports a given view. Caches responses unless the
spring.template.provider.cache property is set to false.- Since:
- 1.4.0
- Author:
- Phillip Webb, Madhura Bhave
-
Constructor Summary
ConstructorsModifierConstructorDescriptionTemplateAvailabilityProviders(ClassLoader classLoader) Create a newTemplateAvailabilityProvidersinstance.protectedTemplateAvailabilityProviders(Collection<? extends TemplateAvailabilityProvider> providers) Create a newTemplateAvailabilityProvidersinstance.TemplateAvailabilityProviders(ApplicationContext applicationContext) Create a newTemplateAvailabilityProvidersinstance. -
Method Summary
Modifier and TypeMethodDescriptiongetProvider(String view, ApplicationContext applicationContext) Get the provider that can be used to render the given view.getProvider(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) Get the provider that can be used to render the given view.Return the underlying providers being used.
-
Constructor Details
-
TemplateAvailabilityProviders
Create a newTemplateAvailabilityProvidersinstance.- Parameters:
applicationContext- the source application context
-
TemplateAvailabilityProviders
Create a newTemplateAvailabilityProvidersinstance.- Parameters:
classLoader- the source class loader
-
TemplateAvailabilityProviders
protected TemplateAvailabilityProviders(Collection<? extends TemplateAvailabilityProvider> providers) Create a newTemplateAvailabilityProvidersinstance.- Parameters:
providers- the underlying providers
-
-
Method Details
-
getProviders
Return the underlying providers being used.- Returns:
- the providers being used
-
getProvider
Get the provider that can be used to render the given view.- Parameters:
view- the view to renderapplicationContext- the application context- Returns:
- a
TemplateAvailabilityProvideror null
-
getProvider
public TemplateAvailabilityProvider getProvider(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) Get the provider that can be used to render the given view.- Parameters:
view- the view to renderenvironment- the environmentclassLoader- the class loaderresourceLoader- the resource loader- Returns:
- a
TemplateAvailabilityProvideror null
-