Class LinkExpirationFormatterMethod

java.lang.Object
org.keycloak.theme.beans.LinkExpirationFormatterMethod
All Implemented Interfaces:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel

public class LinkExpirationFormatterMethod extends Object implements freemarker.template.TemplateMethodModelEx
Method used to format link expiration time period in emails.
Author:
Vlastimil Elias (velias at redhat dot com)
  • Field Details

    • messages

      protected final Properties messages
    • locale

      protected final Locale locale
  • Constructor Details

    • LinkExpirationFormatterMethod

      public LinkExpirationFormatterMethod(Properties messages, Locale locale)
  • Method Details

    • exec

      public Object exec(List arguments) throws freemarker.template.TemplateModelException
      Specified by:
      exec in interface freemarker.template.TemplateMethodModel
      Specified by:
      exec in interface freemarker.template.TemplateMethodModelEx
      Throws:
      freemarker.template.TemplateModelException
    • format

      protected String format(long valueInSeconds)
    • getUnitTextFromMessages

      protected String getUnitTextFromMessages(String unitKey, long value)