Interface TemplateProvider<E extends Template>
- All Superinterfaces:
Provider<E>
- All Known Subinterfaces:
RuleTemplateProvider
This interface has to be implemented by all providers of
Template
s.
The TemplateRegistry
uses it to get access to available Template
s.- Author:
- Yordan Mihaylov - Initial contribution, Kai Kreuzer - refactored (managed) provider and registry implementation, Ana Dimova - add registration property - rule.templates
-
Method Summary
Modifier and TypeMethodDescription@Nullable E
getTemplate
(String uid, @Nullable Locale locale) Gets the localized Templates defined by this provider.getTemplates
(@Nullable Locale locale) Gets the localized Templates defined by this provider.Methods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Method Details
-
getTemplate
Gets the localized Templates defined by this provider. When the localization is not specified or it is not supported a Template localized with default locale is returned.- Parameters:
uid
- unique identifier of the desired Template.locale
- specifies the desiredLocale
to be used for localization of the returned element. If localization resources for this locale are not available or the passed locale isnull
the element is returned with the default localization.- Returns:
- the desired localized Template.
-
getTemplates
Gets the localized Templates defined by this provider. When localization is not specified or it is not supported a Templates with default localization is returned.- Parameters:
locale
- specifies the desiredLocale
to be used for localization of the returned elements. If localization resources for this locale are not available or the passed locale isnull
the elements are returned with the default localization.- Returns:
- a collection of localized
Template
s provided by this provider.
-