Class MessageBundle

java.lang.Object
io.jmix.flowui.view.MessageBundle

@Scope("prototype") @Component("flowui_MessageBundle") public class MessageBundle extends Object
Class that provides messages from a message group bound to view controller.
  • Field Details

    • messages

      protected Messages messages
    • messageGroup

      protected String messageGroup
  • Constructor Details

    • MessageBundle

      public MessageBundle()
  • Method Details

    • setMessages

      @Autowired protected void setMessages(Messages messages)
    • getMessageGroup

      public String getMessageGroup()
      Returns:
      associated message group
    • setMessageGroup

      public void setMessageGroup(String messageGroup)
      Sets source message group.
      Parameters:
      messageGroup - associated message group
    • getMessage

      public String getMessage(String key)
      Gets localized message from the message group associated with this view.
      Parameters:
      key - message key
      Returns:
      localized message
      See Also:
    • formatMessage

      public String formatMessage(String key, Object... params)
      Gets localized message from the message group associated with this view, and uses it as a format string for parameters provided.
      Parameters:
      key - message key
      params - parameter values
      Returns:
      formatted string or the key in case of IllegalFormatException
      See Also: