Class MessageFormat

java.lang.Object
com.kheops.jmap.messages.MessageFormat

public class MessageFormat extends Object
This class provides methods to simplify the localized formatted message creation.
  • Constructor Details

    • MessageFormat

      public MessageFormat()
  • Method Details

    • format

      public static String format(String messageCode, String[] messageArgs)
      Creates a formatted and localized message using the specified message code and arguments. The message code must be present in the resources. If not, the message code is returned.
      Parameters:
      messageCode - used as the key to obtain the message from the resources.
      messageArgs - array of arguments to be inserted in the message.
      Returns:
      the resulting message or the message code if the code is not found in the resources.
    • logFormat

      public static String logFormat(String messageCode, String[] messageArgs)
      Similar to the method format(String, String[]) except that the message returned will include the message code at the beginning. Useful for message logging.
      Parameters:
      messageCode - used as the key to obtain the message from the resources.
      messageArgs - array of arguments to be inserted in the message.
      Returns:
      the resulting message or the message code if the code is not found in the resources.