Class TemplateAvailabilityProviders
- java.lang.Object
- org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders
public class TemplateAvailabilityProviders extends Object
Collection ofTemplateAvailabilityProvider
beans that can be used to check which (if any) templating engine supports a given view. Caches responses unless thespring.template.provider.cache
property is set tofalse
.- Since:
- 1.4.0
Constructor Summary
Constructors Modifier Constructor Description TemplateAvailabilityProviders(ClassLoader classLoader)
Create a newTemplateAvailabilityProviders
instance.protected
TemplateAvailabilityProviders(Collection<? extends TemplateAvailabilityProvider> providers)
Create a newTemplateAvailabilityProviders
instance.TemplateAvailabilityProviders(org.springframework.context.ApplicationContext applicationContext)
Create a newTemplateAvailabilityProviders
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateAvailabilityProvider
getProvider(String view, org.springframework.context.ApplicationContext applicationContext)
Get the provider that can be used to render the given view.TemplateAvailabilityProvider
getProvider(String view, org.springframework.core.env.Environment environment, ClassLoader classLoader, org.springframework.core.io.ResourceLoader resourceLoader)
Get the provider that can be used to render the given view.List<TemplateAvailabilityProvider>
getProviders()
Return the underlying providers being used.
Constructor Detail
TemplateAvailabilityProviders
public TemplateAvailabilityProviders(org.springframework.context.ApplicationContext applicationContext)
Create a newTemplateAvailabilityProviders
instance.- Parameters:
applicationContext
- the source application context
TemplateAvailabilityProviders
public TemplateAvailabilityProviders(ClassLoader classLoader)
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 Detail
getProviders
public List<TemplateAvailabilityProvider> getProviders()
Return the underlying providers being used.- Returns:
- the providers being used
getProvider
public TemplateAvailabilityProvider getProvider(String view, org.springframework.context.ApplicationContext applicationContext)
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, org.springframework.core.env.Environment environment, ClassLoader classLoader, org.springframework.core.io.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