Functions similarly to getProperty(key, defaultValue) but with the difference that if a property with the specified key does not exists, then the property will be set to the defaultValue argument and subsequently returned. @param key the property key @param defaultValue a default
(String key, String defaultValue)
| 124 | * @return the value in this property context with the specified key value. |
| 125 | */ |
| 126 | public String initProperty(String key, String defaultValue) |
| 127 | { |
| 128 | String value = getProperty(key); |
| 129 | if (value != null) |
| 130 | { |
| 131 | return value; |
| 132 | } |
| 133 | setProperty(key, defaultValue); |
| 134 | return defaultValue; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Searches for the property with the specified key in this property context. |
no test coverage detected