public class UnityPropertiesHelper
extends eu.unicore.util.configuration.PropertiesHelper
PropertiesHelper
with Unity specific methods: returning localized strings
and caching of getSortedStringKeys(String, boolean)
method results.Modifier and Type | Field and Description |
---|---|
protected Map<String,Set<String>> |
listKeysCache |
Modifier | Constructor and Description |
---|---|
|
UnityPropertiesHelper(String prefix,
Properties properties,
Map<String,eu.unicore.util.configuration.PropertyMD> propertiesMD,
org.apache.log4j.Logger log) |
protected |
UnityPropertiesHelper(UnityPropertiesHelper cloned)
For cloning
|
Modifier and Type | Method and Description |
---|---|
void |
addCachedPrefixes(String... prefixRegexp)
All properties which start with the given regexp will be cached in a way that
all properties starting with this prefix can be quickly retrieved using
getSortedStringKeys(String, boolean) . |
protected void |
cacheIfNeeded(String key) |
pl.edu.icm.unity.types.I18nString |
getLocalizedString(pl.edu.icm.unity.MessageSource msg,
String baseKey) |
protected Set<String> |
getSortedStringKeys(String base,
boolean allowListSubKeys) |
protected boolean |
isCached(String key) |
protected void |
refillCache() |
void |
setProperties(Properties properties) |
void |
setProperty(String key,
String value) |
addPropertyChangeListener, canHaveSubkeys, checkBounds, checkConstraints, checkConstraints, checkDeprecated, checkPropertyConstraints, checkStructuredListConstraints, clone, cloneTo, filterChanged, findUnknown, getBooleanValue, getClassValue, getDoubleValue, getDoubleValueNoCheck, getEnumValue, getFileValue, getFileValueAsString, getIntValue, getIntValueNoCheck, getKeyDescription, getListOfValues, getLocalizedValue, getLongValue, getLongValueNoCheck, getMetadata, getMetadataKey, getRawProperty, getSortedNumKeys, getStructuredListKeys, getSubkeyBooleanValue, getSubkeyEnumValue, getSubkeyIntValue, getSubkeyLongValue, getSubkeyValue, getValue, isSet, logValue, notifyAllWithKey, notifyFocusedListeners, notifyGenericListeners, removePropertyChangeListener
public UnityPropertiesHelper(String prefix, Properties properties, Map<String,eu.unicore.util.configuration.PropertyMD> propertiesMD, org.apache.log4j.Logger log)
protected UnityPropertiesHelper(UnityPropertiesHelper cloned)
cloned
- public void addCachedPrefixes(String... prefixRegexp)
getSortedStringKeys(String, boolean)
.
This also optimizes uses of PropertiesHelper.getListOfValues(String)
which relies on the above methods.
Note that the regexp must include the main prefix of this properties object.prefixRegexp
- public void setProperties(Properties properties)
setProperties
in interface eu.unicore.util.configuration.PropertiesHelperAPI
setProperties
in interface eu.unicore.util.configuration.UpdateableConfiguration
setProperties
in class eu.unicore.util.configuration.PropertiesHelper
public void setProperty(String key, String value)
setProperty
in interface eu.unicore.util.configuration.PropertiesHelperAPI
setProperty
in class eu.unicore.util.configuration.PropertiesHelper
protected void refillCache()
protected void cacheIfNeeded(String key)
protected boolean isCached(String key)
protected Set<String> getSortedStringKeys(String base, boolean allowListSubKeys)
getSortedStringKeys
in class eu.unicore.util.configuration.PropertiesHelper
public pl.edu.icm.unity.types.I18nString getLocalizedString(pl.edu.icm.unity.MessageSource msg, String baseKey)
msg
- baseKey
- Property name (without the prefix).Copyright © 2018 Unity. All rights reserved.