public class ExtendedProperties extends Properties
getProperty(String),
Serialized Formdefaults| Constructor and Description |
|---|
ExtendedProperties() |
ExtendedProperties(Properties defs) |
| Modifier and Type | Method and Description |
|---|---|
String |
getProperty(String key)
Any parameter like
${propertyName} in property value will
be replaced with the value of property with name
propertyName. |
String |
getProperty(String key,
String defaultValue) |
ExtendedProperties |
getSubset(String prefix) |
ExtendedProperties |
getSubset(String prefix,
String newPrefix) |
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 ExtendedProperties()
Properties.Properties()public ExtendedProperties(Properties defs)
public String getProperty(String key)
${propertyName} in property value will
be replaced with the value of property with name
propertyName.
For example, for the following set of properties:
param1=abcd
param2=efgh
param3=Alphabet starts with: ${param1}${param2}
The call props.getProperty("param3") returns:
Alphabet starts with: abcdefghNote also that call
props.get("param3") returns:
Alphabet starts with: ${param1}${param2}
So the Map.get(java.lang.Object) works as usual and
returns raw (not expanded with substituted parameters) property value.
getProperty in class PropertiesProperties.getProperty(java.lang.String)public String getProperty(String key, String defaultValue)
getProperty in class PropertiesProperties.getProperty(java.lang.String, java.lang.String)public ExtendedProperties getSubset(String prefix)
prefix - string, each property key should start with (this prefix
will NOT be included into new key)public ExtendedProperties getSubset(String prefix, String newPrefix)
prefix - string, each property key should start withnewPrefix - new prefix to be added to each key instead of existing
prefixCopyright © 2016. All rights reserved.