Class HandlebarsTemplateParams.Builder

java.lang.Object
com.jalios.jcms.uicomponent.handlebars.HandlebarsTemplateParams.Builder
Enclosing class:
HandlebarsTemplateParams

public static class HandlebarsTemplateParams.Builder extends Object
Builder class for constructing HandlebarsTemplateParams instances. Supports adding localized text, icons, and custom parameters.
Since:
jcms-11.0.0
  • Method Details

    • addIcon

      public HandlebarsTemplateParams.Builder addIcon(String key, String iconSrc)
      Adds an icon using its key and source identifier.
      Parameters:
      key - the parameter key under which the icon will be stored
      iconSrc - the icon identifier used by IconManager
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addIcon

      public HandlebarsTemplateParams.Builder addIcon(String key, String iconSrc, String css, String alt)
      Adds an icon with custom CSS and alt attributes.
      Parameters:
      key - the parameter key under which the icon will be stored
      iconSrc - the icon identifier used by IconManager
      css - the CSS classes to apply
      alt - the alternative text for accessibility
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addIcon

      Adds an icon using advanced HandlebarsTemplateParams.IconParams options.
      Parameters:
      key - the parameter key under which the icon will be stored
      iconSrc - the icon identifier used by IconManager
      iconParams - optional parameters for customizing icon rendering
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addI18n

      public HandlebarsTemplateParams.Builder addI18n(String key, String glpKey, Object... glpParams)
      Adds a localized label using a GLP key and optional parameters.
      Parameters:
      key - the parameter key under which the label will be stored
      glpKey - the GLP key to translate
      glpParams - optional arguments for the GLP translation
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addParam

      public HandlebarsTemplateParams.Builder addParam(String key, Object value)
      Adds a generic parameter to the Handlebars context.
      Parameters:
      key - the parameter name
      value - the parameter value
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addObject

      Adds a nested object to the Handlebars context using a child builder. The child builder inherits the language configured on the parent builder.
      Parameters:
      key - the parameter key under which the object will be stored
      configurer - the consumer used to configure the nested object
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • addObject

      Adds an existing Handlebars parameters object as a nested object.
      Parameters:
      key - the parameter key under which the object will be stored
      object - the Handlebars parameters object to add
      Returns:
      this builder for chaining
      Since:
      jcms-11.0.0
    • build

      public HandlebarsTemplateParams build()
      Builds a HandlebarsTemplateParams instance with the configured parameters.
      Returns:
      a new HandlebarsTemplateParams object
      Since:
      jcms-11.0.0