Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public abstract class ModifiablePropertiesResourceBundle extends ModifiableResourceBundle
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.aoindustries.swing.ApplicationResources_ja
would load its properties from com/aoindustries/swing/ApplicationResources_ja.properties.
Idea: Occasionally check sourceFile and reload properties if externally modified.
ResourceBundle.Controlparent| Constructor and Description |
|---|
ModifiablePropertiesResourceBundle(File... sourceFiles) |
| Modifier and Type | Method and Description |
|---|---|
Enumeration<String> |
getKeys() |
Long |
getModifiedTime(String key)
Provides direct read access to the modified times.
|
Long |
getValidatedTime(String key)
Provides direct read access to the validated times.
|
protected String |
getValue(String key)
Provides direct read access to the value.
|
protected Object |
handleGetObject(String key) |
protected Set<String> |
handleKeySet() |
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 |
isModifiable()
Checks if this bundle is currently modifiable.
|
static boolean |
isTrackingKey(String key)
Checks if a key is used for tracking status.
|
Set<String> |
keySetNoParents() |
removeKey, setObject, setString, setStringArrayclearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParentpublic ModifiablePropertiesResourceBundle(File... sourceFiles)
sourceFile - 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.public static boolean isTrackingKey(String key)
protected Object handleGetObject(String key)
handleGetObject in class ResourceBundlepublic Enumeration<String> getKeys()
getKeys in class ResourceBundleprotected Set<String> handleKeySet()
handleKeySet in class ResourceBundlepublic boolean isModifiable()
ModifiableResourceBundleisModifiable in class ModifiableResourceBundleprotected void handleRemoveKey(String key)
ModifiableResourceBundlehandleRemoveKey in class ModifiableResourceBundleModifiableResourceBundle.isModifiable()protected void handleSetObject(String key, Object value, boolean modified)
ModifiableResourceBundlepublic Long getValidatedTime(String key)
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.