Interface TemplateProvider<E extends Template>

All Superinterfaces:
Provider<E>
All Known Subinterfaces:
RuleTemplateProvider

@NonNullByDefault public interface TemplateProvider<E extends Template> extends Provider<E>
This interface has to be implemented by all providers of Templates. The TemplateRegistry uses it to get access to available Templates.
Author:
Yordan Mihaylov - Initial contribution, Kai Kreuzer - refactored (managed) provider and registry implementation, Ana Dimova - add registration property - rule.templates
  • Method Details

    • getTemplate

      @Nullable E getTemplate(String uid, @Nullable Locale locale)
      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 desired Locale to be used for localization of the returned element. If localization resources for this locale are not available or the passed locale is null the element is returned with the default localization.
      Returns:
      the desired localized Template.
    • getTemplates

      Collection<E> getTemplates(@Nullable Locale locale)
      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 desired Locale to be used for localization of the returned elements. If localization resources for this locale are not available or the passed locale is null the elements are returned with the default localization.
      Returns:
      a collection of localized Templates provided by this provider.