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 StringThe filename extension of resource files, without leading dot.The formats supported by this loader.static final LoaderThe singleton instance of theLoaderclass.Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLoader()Creates the unique instance of the SIS resource bundle loader. -
Method Summary
Modifier and TypeMethodDescriptiongetFormats(String baseName) Returns the formats supported by this loader.booleanneedsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) Returnsfalsein 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 theLoaderclass.
-
-
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:
getFormatsin 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) Returnsfalsein all cases, since our implementation never needs reload.- Overrides:
needsReloadin 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:
newBundlein 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:
IllegalAccessExceptionInstantiationExceptionIOException
-