Module com.aoapps.hodgepodge
Package com.aoapps.hodgepodge.i18n
Class ModifiablePropertiesResourceBundle
java.lang.Object
java.util.ResourceBundle
com.aoapps.hodgepodge.i18n.ModifiableResourceBundle
com.aoapps.hodgepodge.i18n.ModifiablePropertiesResourceBundle
- Direct Known Subclasses:
EditableResourceBundle
Wraps the resources with XHTML and scripts to allow the modification of the
resource bundle contents directly through the web interface. Also adds an
indicator when the resource need to be verified. Verification is required
when any other locale has a modified time greater than the verified time
of this locale.
The properties file should have the same name as this class, including any language
or locale. For instance, class com.aoapps.hodgepodge.swing.ApplicationResources_ja
would load its properties from com/aoapps/hodgepodge/swing/ApplicationResources_ja.properties
.
Idea: Occasionally check sourceFile and reload properties if externally modified.
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
-
Field Summary
FieldsFields inherited from class java.util.ResourceBundle
parent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKeys()
getModifiedTime
(String key) Provides direct read access to the modified times.getValidatedTime
(String key) Provides direct read access to the validated times.protected String
Provides direct read access to the value.protected Object
handleGetObject
(String key) protected void
handleRemoveKey
(String key) This will only be called on modifiable bundles.protected void
handleSetObject
(String key, Object value, boolean modified) This will only be called on modifiable bundles.boolean
Checks if this bundle is currently modifiable.static boolean
isTrackingKey
(String key) Checks if a key is used for tracking status.Methods inherited from class com.aoapps.hodgepodge.i18n.ModifiableResourceBundle
removeKey, setObject, setString, setStringArray
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParent
-
Field Details
-
PROPERTIES_KEY_COMPARATOR
-
-
Constructor Details
-
ModifiablePropertiesResourceBundle
- Parameters:
sourceFiles
- The source file(s). If multiple source files are provided, only one may exist and be both readable and writable. If more than one possible source file exists, will throw an IllegalStateException.
-
-
Method Details
-
isTrackingKey
Checks if a key is used for tracking status. -
handleGetObject
- Specified by:
handleGetObject
in classResourceBundle
-
getKeys
- Specified by:
getKeys
in classResourceBundle
-
handleKeySet
- Overrides:
handleKeySet
in classResourceBundle
-
keySetNoParents
-
isModifiable
public boolean isModifiable()Description copied from class:ModifiableResourceBundle
Checks if this bundle is currently modifiable.- Specified by:
isModifiable
in classModifiableResourceBundle
-
handleRemoveKey
Description copied from class:ModifiableResourceBundle
This will only be called on modifiable bundles.- Specified by:
handleRemoveKey
in classModifiableResourceBundle
- See Also:
-
handleSetObject
Description copied from class:ModifiableResourceBundle
This will only be called on modifiable bundles.- Specified by:
handleSetObject
in classModifiableResourceBundle
- See Also:
-
getValue
Provides direct read access to the value. -
getValidatedTime
Provides direct read access to the validated times. -
getModifiedTime
Provides direct read access to the modified times.
-