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
ModifierConstructorDescriptionTemplateAvailabilityProviders
(ClassLoader classLoader) Create a newTemplateAvailabilityProviders
instance.protected
TemplateAvailabilityProviders
(Collection<? extends TemplateAvailabilityProvider> providers) Create a newTemplateAvailabilityProviders
instance.TemplateAvailabilityProviders
(ApplicationContext applicationContext) Create a newTemplateAvailabilityProviders
instance. -
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 newTemplateAvailabilityProviders
instance.- Parameters:
applicationContext
- the source application context
-
TemplateAvailabilityProviders
Create a newTemplateAvailabilityProviders
instance.- Parameters:
classLoader
- the source class loader
-
TemplateAvailabilityProviders
protected TemplateAvailabilityProviders(Collection<? extends TemplateAvailabilityProvider> providers) Create a newTemplateAvailabilityProviders
instance.- 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
TemplateAvailabilityProvider
or 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
TemplateAvailabilityProvider
or null
-