public class XProperties extends Properties
Properties class which performs the following when you call getProperty:
1. Checks to see if there are any variables in the property 2. If so it replaces the variable with with the first
match it finds in the following order - The java properties (java -Dkey=value) - The component context properties
(set using setBundleContext) - The properties set in the object itself - The container's environment variables This
class operates identically to a standard Properties object in all other respects.| Modifier and Type | Field and Description |
|---|---|
static String |
END_REPLACEMENT |
static String |
START_REPLACEMENT |
defaults| Constructor and Description |
|---|
XProperties() |
| Modifier and Type | Method and Description |
|---|---|
String |
expandVariable(String variable)
Returns the value of a variable with the same priority replacement scheme as getProperty.
|
org.osgi.framework.BundleContext |
getBundleContext()
Return the current
BundleContext that's in use by this object. |
String |
getProperty(String key)
See the class description for more details.
|
String |
getUninterpretedProperty(String key)
A wrapper around the old getProperty behaviour, this method does not do any variable expansion.
|
void |
merge(Dictionary<String,String> p)
Merges the properties from p into this properties object
|
String |
replacePropertiesInCustomString(String customString)
This goes through the customString provided by the client and checks for any properties that they may wish
substituted by ConfigurationManager properties such as ${capture.filesystem.cache.capture.url} would be replaced by
the actual location of the capture cache.
|
void |
setBundleContext(org.osgi.framework.BundleContext ctx)
Sets the
BundleContext for this object. |
getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamesclear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, valuespublic static final String START_REPLACEMENT
public static final String END_REPLACEMENT
public String getProperty(String key)
getProperty in class PropertiesProperties.getProperty(java.lang.String)public String replacePropertiesInCustomString(String customString)
customString - The String that you want to substitute the properties intopublic String expandVariable(String variable)
variable - The variable you need the replacement for.getProperty(String)public String getUninterpretedProperty(String key)
key - The key of the propertypublic void merge(Dictionary<String,String> p)
p - The Dictionary you wish to add to this objectpublic void setBundleContext(org.osgi.framework.BundleContext ctx)
BundleContext for this object. Set this to null if you wish to skip checking the context for a
property.ctx - The BundleContext for this instance.public org.osgi.framework.BundleContext getBundleContext()
BundleContext that's in use by this object.BundleContextCopyright © 2009–2021 Opencast Project. All rights reserved.