Package io.microsphere.util
Class PropertyResourceBundleUtils
- java.lang.Object
-
- io.microsphere.util.PropertyResourceBundleUtils
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_ENCODINGThe default encoding forPropertyResourceBundlestatic java.lang.StringDEFAULT_ENCODING_PROPERTY_NAMEThe property name of encoding forPropertyResourceBundle
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.ResourceBundlegetBundle(java.lang.String baseName)ResourceBundle.getBundle(String, Locale)withdefault file encodingencoding anddefault LocaleunderThread context ClassLoaderstatic java.util.ResourceBundlegetBundle(java.lang.String baseName, java.lang.String encoding)ResourceBundle.getBundle(String, Locale)with specified encoding anddefault LocaleunderThread context ClassLoaderstatic java.util.ResourceBundlegetBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader classLoader, java.lang.String encoding)ResourceBundle.getBundle(String, Locale, ClassLoader)with specified encodingstatic java.util.ResourceBundlegetBundle(java.lang.String baseName, java.util.Locale locale, java.lang.String encoding)ResourceBundle.getBundle(String, Locale)with specified encoding underThread context ClassLoader
-
-
-
Field Detail
-
DEFAULT_ENCODING_PROPERTY_NAME
public static final java.lang.String DEFAULT_ENCODING_PROPERTY_NAME
The property name of encoding forPropertyResourceBundle- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final java.lang.String DEFAULT_ENCODING
The default encoding forPropertyResourceBundle
-
-
Method Detail
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String baseName)
ResourceBundle.getBundle(String, Locale)withdefault file encodingencoding anddefault LocaleunderThread context ClassLoader- Parameters:
baseName- the base name of the resource bundle, a fully qualified class name- Returns:
- Throws:
java.lang.NullPointerException- ifbaseName,locale, orloaderisnulljava.util.MissingResourceException- if no resource bundle for the specified base name can be foundjava.lang.IllegalArgumentException- if the givencontroldoesn't perform properly (e.g.,control.getCandidateLocalesreturns null.) Note that validation ofcontrolis performed as needed.
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String baseName, java.lang.String encoding)ResourceBundle.getBundle(String, Locale)with specified encoding anddefault LocaleunderThread context ClassLoader- Parameters:
baseName- the base name of the resource bundle, a fully qualified class nameencoding- the control which gives information for the resource bundle loading process- Returns:
- Throws:
java.lang.NullPointerException- ifbaseNameisnulljava.util.MissingResourceException- if no resource bundle for the specified base name can be foundjava.lang.IllegalArgumentException- if the givencontroldoesn't perform properly (e.g.,control.getCandidateLocalesreturns null.) Note that validation ofcontrolis performed as needed.
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String baseName, java.util.Locale locale, java.lang.String encoding)ResourceBundle.getBundle(String, Locale)with specified encoding underThread context ClassLoader- Parameters:
baseName- the base name of the resource bundle, a fully qualified class namelocale- the locale for which a resource bundle is desiredencoding- the control which gives information for the resource bundle loading process- Returns:
- Throws:
java.lang.NullPointerException- ifbaseName,localeisnulljava.util.MissingResourceException- if no resource bundle for the specified base name can be foundjava.lang.IllegalArgumentException- if the givencontroldoesn't perform properly (e.g.,control.getCandidateLocalesreturns null.) Note that validation ofcontrolis performed as needed.
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader classLoader, java.lang.String encoding)ResourceBundle.getBundle(String, Locale, ClassLoader)with specified encoding- Parameters:
baseName- the base name of the resource bundle, a fully qualified class namelocale- the locale for which a resource bundle is desiredclassLoader- the class loader from which to load the resource bundleencoding- the control which gives information for the resource bundle loading process- Returns:
- Throws:
java.lang.NullPointerException- ifbaseName,locale, orloaderisnulljava.util.MissingResourceException- if no resource bundle for the specified base name can be foundjava.lang.IllegalArgumentException- if the givencontroldoesn't perform properly (e.g.,control.getCandidateLocalesreturns null.) Note that validation ofcontrolis performed as needed.
-
-