Package io.microsphere.util
Class PropertyResourceBundleControl
- java.lang.Object
-
- java.util.ResourceBundle.Control
-
- io.microsphere.util.PropertyResourceBundleControl
-
public class PropertyResourceBundleControl extends java.util.ResourceBundle.Control
PropertyResourceBundle
ResourceBundle.Control
Implementation which supports encodingProperties
files- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
PropertyResourceBundle
,ResourceBundle.Control
-
-
Field Summary
Fields Modifier and Type Field Description static PropertyResourceBundleControl
DEFAULT_CONTROL
The singleton instance ofPropertyResourceBundleControl
as defaultstatic java.lang.String
SUFFIX
The suffix of the properties file
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertyResourceBundleControl()
protected
PropertyResourceBundleControl(java.lang.String encoding)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEncoding()
Sets the encoding of properties file.java.util.List<java.lang.String>
getFormats(java.lang.String baseName)
java.util.ResourceBundle
newBundle(java.lang.String baseName, java.util.Locale locale, java.lang.String format, java.lang.ClassLoader classLoader, boolean reload)
static java.util.ResourceBundle.Control
newControl(java.lang.String encoding)
Creates a new instance ofPropertyResourceBundleControl
if absent.
-
-
-
Field Detail
-
SUFFIX
public static final java.lang.String SUFFIX
The suffix of the properties file- See Also:
- Constant Field Values
-
DEFAULT_CONTROL
public static final PropertyResourceBundleControl DEFAULT_CONTROL
The singleton instance ofPropertyResourceBundleControl
as default
-
-
Constructor Detail
-
PropertyResourceBundleControl
protected PropertyResourceBundleControl() throws java.nio.charset.UnsupportedCharsetException
- Throws:
java.nio.charset.UnsupportedCharsetException
-
PropertyResourceBundleControl
protected PropertyResourceBundleControl(java.lang.String encoding) throws java.nio.charset.UnsupportedCharsetException
- Parameters:
encoding
- the encoding- Throws:
java.nio.charset.UnsupportedCharsetException
- Ifencoding
is not supported
-
-
Method Detail
-
getFormats
public final java.util.List<java.lang.String> getFormats(java.lang.String baseName)
- Overrides:
getFormats
in classjava.util.ResourceBundle.Control
-
newBundle
public java.util.ResourceBundle newBundle(java.lang.String baseName, java.util.Locale locale, java.lang.String format, java.lang.ClassLoader classLoader, boolean reload) throws java.io.IOException
- Overrides:
newBundle
in classjava.util.ResourceBundle.Control
- Throws:
java.io.IOException
-
getEncoding
public java.lang.String getEncoding()
Sets the encoding of properties file.- Returns:
- the encoding
-
newControl
public static java.util.ResourceBundle.Control newControl(java.lang.String encoding) throws java.nio.charset.UnsupportedCharsetException
Creates a new instance ofPropertyResourceBundleControl
if absent.- Parameters:
encoding
- Encoding- Returns:
- Control
- Throws:
java.nio.charset.UnsupportedCharsetException
- Ifencoding
is not supported
-
-