Interface MessageBundle


public interface MessageBundle
An overridable resource bundle.

Unlike standard ResourceBundle, missing resource keys do not throw exceptions. Instead, missing keys return a formatted fallback string in the format "!missing_key!" to make missing resources obvious while preventing application crashes.

See Also:
  • Method Details

    • getString

      String getString(String key)
      Parameters:
      key - the key
      Returns:
      the string associated with the given key, or "!key!" if the key is not found
    • messageBundle

      static MessageBundle messageBundle(Class<?> resourceOwner, ResourceBundle bundle)
      Parameters:
      resourceOwner - the resource owner
      bundle - the resource bundle to override
      Returns:
      a new MessageBundle instance