Interface TemplateRegistry<E extends Template>

All Superinterfaces:
Registry<E,String>

@NonNullByDefault public interface TemplateRegistry<E extends Template> extends Registry<E,String>
This interface provides functionality to get available Templates. The Template can be returned localized depending on locale parameter. When the parameter is not specified or there is no such localization resources the returned template is localized with default locale.
Author:
Yordan Mihaylov - Initial contribution, Ana Dimova - Initial contribution, Vasil Ilchev - Initial contribution
  • Method Details

    • get

      @Nullable E get(String uid, @Nullable Locale locale)
      Gets a template specified by unique identifier.
      Parameters:
      uid - the unique identifier in scope of registered templates.
      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 template instance or null if a template with such UID does not exist or the passed UID is null.
    • getByTag

      Collection<E> getByTag(@Nullable String tag)
      Gets the templates filtered by tag.
      Parameters:
      tag - determines the tag that the templates must have, to be included in the returned result. If it is null then the result will contain all available templates.
      Returns:
      a collection of templates, which correspond to the specified tag.
    • getByTag

      Collection<E> getByTag(@Nullable String tag, @Nullable Locale locale)
      Gets the templates filtered by tag.
      Parameters:
      tag - determines the tag that the templates must have, to be included in the returned result. If it is null then the result will contain all available templates.
      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, which correspond to the specified tag.
    • getByTags

      Collection<E> getByTags(String... tags)
      Gets the templates filtered by tags.
      Parameters:
      tags - determines the set of tags that the templates must have, to be included in the returned result. If it is null then the result will contain all templates.
      Returns:
      a collection of templates, which correspond to the specified set of tags.
    • getByTags

      Collection<E> getByTags(@Nullable Locale locale, String... tags)
      Gets the templates filtered by tags.
      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.
      tags - determines the set of tags that the templates must have, to be included in the returned result. If it is null then the result will contain all templates.
      Returns:
      the templates, which correspond to the specified set of tags.
    • getAll

      Collection<E> getAll(@Nullable Locale locale)
      Gets all available templates, localized by specified locale.
      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, corresponding to the parameterized type.