Package com.aoindustries.util.i18n
Class ModifiableResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- com.aoindustries.util.i18n.ModifiableResourceBundle
-
- Direct Known Subclasses:
ModifiablePropertiesResourceBundle
public abstract class ModifiableResourceBundle extends ResourceBundle
A modifiable resource bundle allows the resources to be changed during the execution of the application. It also keeps track of the modification and verification times for the keys to help keep multiple translations in sync throughout the lifetime of an application.- Author:
- AO Industries, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
-
-
Field Summary
-
Fields inherited from class java.util.ResourceBundle
parent
-
-
Constructor Summary
Constructors Constructor Description ModifiableResourceBundle()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidhandleRemoveKey(String key)This will only be called on modifiable bundles.protected abstract voidhandleSetObject(String key, Object value, boolean modified)This will only be called on modifiable bundles.abstract booleanisModifiable()Checks if this bundle is currently modifiable.voidremoveKey(String key)Removes a string.voidsetObject(String key, Object value, boolean modified)Adds or updates the value associated with the provided key and sets the verified time to the current time.voidsetString(String key, String value, boolean modified)voidsetStringArray(String key, String[] value, boolean modified)-
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getKeys, getLocale, getObject, getString, getStringArray, handleGetObject, handleKeySet, keySet, setParent
-
-
-
-
Method Detail
-
removeKey
public final void removeKey(String key)
Removes a string.
-
handleRemoveKey
protected abstract void handleRemoveKey(String key)
This will only be called on modifiable bundles.- See Also:
isModifiable()
-
setObject
public final void setObject(String key, Object value, boolean modified)
Adds or updates the value associated with the provided key and sets the verified time to the current time. Ifmodifiedistrue, the modified time will also be updated, which will cause other locales to require verification.
-
isModifiable
public abstract boolean isModifiable()
Checks if this bundle is currently modifiable.
-
-