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
ConstructorsModifierConstructorDescriptionprotectedModifiablePropertiesResourceBundle(File... sourceFiles) TODO: Require source files exist for *-devel ApplicationResources*.properties in dev mode. -
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 StringProvides direct read access to the value.protected ObjecthandleGetObject(String key) protected voidhandleRemoveKey(String key) This will only be called on modifiable bundles.protected voidhandleSetObject(String key, Object value, boolean modified) This will only be called on modifiable bundles.booleanChecks if this bundle is currently modifiable.static booleanisTrackingKey(String key) Checks if a key is used for tracking status.Methods inherited from class com.aoapps.hodgepodge.i18n.ModifiableResourceBundle
removeKey, setObject, setString, setStringArrayMethods 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
TODO: Require source files exist for *-devel ApplicationResources*.properties in dev mode.- 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:
handleGetObjectin classResourceBundle
-
getKeys
- Specified by:
getKeysin classResourceBundle
-
handleKeySet
- Overrides:
handleKeySetin classResourceBundle
-
keySetNoParents
-
isModifiable
public boolean isModifiable()Description copied from class:ModifiableResourceBundleChecks if this bundle is currently modifiable.- Specified by:
isModifiablein classModifiableResourceBundle
-
handleRemoveKey
Description copied from class:ModifiableResourceBundleThis will only be called on modifiable bundles.- Specified by:
handleRemoveKeyin classModifiableResourceBundle- See Also:
-
handleSetObject
Description copied from class:ModifiableResourceBundleThis will only be called on modifiable bundles.- Specified by:
handleSetObjectin 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.
-
