Package org.apache.sis.util.resources
Class Loader
java.lang.Object
java.util.ResourceBundle.Control
org.apache.sis.util.resources.Loader
Controls the resource bundle loading. This class looks for
.utf
files rather than
the Java default .class
or .properties
files.- Since:
- 0.3
- Version:
- 0.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The filename extension of resource files, without leading dot.The formats supported by this loader.static final Loader
The singleton instance of theLoader
class.Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Loader()
Creates the unique instance of the SIS resource bundle loader. -
Method Summary
Modifier and TypeMethodDescriptiongetFormats
(String baseName) Returns the formats supported by this loader.boolean
needsReload
(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) Returnsfalse
in all cases, since our implementation never needs reload.newBundle
(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) Instantiates a new resource bundle.Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getFallbackLocale, getNoFallbackControl, getTimeToLive, toBundleName, toResourceName
-
Field Details
-
EXTENSION
The filename extension of resource files, without leading dot.- See Also:
-
FORMATS
The formats supported by this loader. -
INSTANCE
The singleton instance of theLoader
class.
-
-
Constructor Details
-
Loader
private Loader()Creates the unique instance of the SIS resource bundle loader.
-
-
Method Details
-
getFormats
Returns the formats supported by this loader. The only supported format is"apache-sis.utf"
.- Overrides:
getFormats
in classResourceBundle.Control
- Parameters:
baseName
- ignored.- Returns:
- the supported formats.
-
needsReload
public boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) Returnsfalse
in all cases, since our implementation never needs reload.- Overrides:
needsReload
in classResourceBundle.Control
-
newBundle
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException Instantiates a new resource bundle.- Overrides:
newBundle
in classResourceBundle.Control
- Parameters:
baseName
- the fully qualified name of the base resource bundle.locale
- the locale for which the resource bundle should be instantiated.format
- ignored since this loader supports only one format.loader
- the class loader to use.reload
- ignored since this loader does not support resource expiration.- Returns:
- the resource bundle instance, or null if none could be found.
- Throws:
IllegalAccessException
InstantiationException
IOException
-