Package org.opencastproject.util
Class XProperties
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
An extension to the
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.- See Also:
-
Field Summary
FieldsFields inherited from class java.util.Properties
defaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.osgi.framework.BundleContextReturn the currentBundleContextthat's in use by this object.getProperty(String key) See the class description for more details.A wrapper around the old getProperty behaviour, this method does not do any variable expansion.voidmerge(Dictionary<String, String> p) Merges the properties from p into this properties objectvoidsetBundleContext(org.osgi.framework.BundleContext ctx) Sets theBundleContextfor this object.Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
START_REPLACEMENT
- See Also:
-
END_REPLACEMENT
- See Also:
-
-
Constructor Details
-
XProperties
public XProperties()
-
-
Method Details
-
getProperty
See the class description for more details.- Overrides:
getPropertyin classProperties- See Also:
-
getUninterpretedProperty
A wrapper around the old getProperty behaviour, this method does not do any variable expansion.- Parameters:
key- The key of the property- Returns:
- The property exactly as it appears in the properties list without any variable expansion
-
merge
Merges the properties from p into this properties object- Parameters:
p- TheDictionaryyou wish to add to this object
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext ctx) Sets theBundleContextfor this object. Set this to null if you wish to skip checking the context for a property.- Parameters:
ctx- TheBundleContextfor this instance.
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()Return the currentBundleContextthat's in use by this object.- Returns:
- The current
BundleContext
-