Class HandlebarsTemplateParams.Builder
java.lang.Object
com.jalios.jcms.uicomponent.handlebars.HandlebarsTemplateParams.Builder
- Enclosing class:
HandlebarsTemplateParams
Builder class for constructing
HandlebarsTemplateParams instances.
Supports adding localized text, icons, and custom parameters.- Since:
- jcms-11.0.0
-
Method Summary
Modifier and TypeMethodDescriptionAdds a localized label using a GLP key and optional parameters.Adds an icon using its key and source identifier.addIcon(String key, String iconSrc, HandlebarsTemplateParams.IconParams iconParams) Adds an icon using advancedHandlebarsTemplateParams.IconParamsoptions.Adds an icon with custom CSS and alt attributes.addObject(String key, HandlebarsTemplateParams object) Adds an existing Handlebars parameters object as a nested object.addObject(String key, Consumer<HandlebarsTemplateParams.Builder> configurer) Adds a nested object to the Handlebars context using a child builder.Adds a generic parameter to the Handlebars context.build()Builds aHandlebarsTemplateParamsinstance with the configured parameters.
-
Method Details
-
addIcon
Adds an icon using its key and source identifier.- Parameters:
key- the parameter key under which the icon will be storediconSrc- the icon identifier used byIconManager- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
addIcon
Adds an icon with custom CSS and alt attributes.- Parameters:
key- the parameter key under which the icon will be storediconSrc- the icon identifier used byIconManagercss- the CSS classes to applyalt- the alternative text for accessibility- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
addIcon
public HandlebarsTemplateParams.Builder addIcon(String key, String iconSrc, HandlebarsTemplateParams.IconParams iconParams) Adds an icon using advancedHandlebarsTemplateParams.IconParamsoptions.- Parameters:
key- the parameter key under which the icon will be storediconSrc- the icon identifier used byIconManagericonParams- optional parameters for customizing icon rendering- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
addI18n
Adds a localized label using a GLP key and optional parameters.- Parameters:
key- the parameter key under which the label will be storedglpKey- the GLP key to translateglpParams- optional arguments for the GLP translation- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
addParam
Adds a generic parameter to the Handlebars context.- Parameters:
key- the parameter namevalue- the parameter value- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
addObject
public HandlebarsTemplateParams.Builder addObject(String key, Consumer<HandlebarsTemplateParams.Builder> configurer) 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 storedconfigurer- 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 storedobject- the Handlebars parameters object to add- Returns:
- this builder for chaining
- Since:
- jcms-11.0.0
-
build
Builds aHandlebarsTemplateParamsinstance with the configured parameters.- Returns:
- a new
HandlebarsTemplateParamsobject - Since:
- jcms-11.0.0
-