Class UTF8ResourceBundleControl


  • public final class UTF8ResourceBundleControl
    extends java.util.ResourceBundle.Control
    A ResourceBundle.Control that enforces UTF-8 string encoding.

    See https://stackoverflow.com/a/4660195 for more details.

    Since:
    4.0.0
    • Field Summary

      • Fields inherited from class java.util.ResourceBundle.Control

        FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.util.ResourceBundle.Control get()
      Gets the shared instance.
      java.util.ResourceBundle newBundle​(java.lang.String baseName, java.util.Locale locale, java.lang.String format, java.lang.ClassLoader loader, boolean reload)  
      • Methods inherited from class java.util.ResourceBundle.Control

        getCandidateLocales, getControl, getFallbackLocale, getFormats, getNoFallbackControl, getTimeToLive, needsReload, toBundleName, toResourceName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UTF8ResourceBundleControl

        public UTF8ResourceBundleControl()
    • Method Detail

      • get

        public static @NotNull java.util.ResourceBundle.Control get()
        Gets the shared instance.
        Returns:
        a resource bundle control
        Since:
        4.0.0
      • newBundle

        public java.util.ResourceBundle newBundle​(java.lang.String baseName,
                                                  java.util.Locale locale,
                                                  java.lang.String format,
                                                  java.lang.ClassLoader loader,
                                                  boolean reload)
                                           throws java.lang.IllegalAccessException,
                                                  java.lang.InstantiationException,
                                                  java.io.IOException
        Overrides:
        newBundle in class java.util.ResourceBundle.Control
        Throws:
        java.lang.IllegalAccessException
        java.lang.InstantiationException
        java.io.IOException