public class PropertyUtils
extends java.lang.Object
Constructor and Description |
---|
PropertyUtils() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.Set<java.lang.String> |
findReferencedVariableNames(java.lang.String value,
int beginningOffset) |
protected static java.util.Set<java.lang.String> |
findSettingsNeedingResolution(java.util.Properties props) |
protected static java.lang.String |
replaceVariableWithValue(java.lang.String variableName,
java.lang.String variableValue,
java.lang.String baseString) |
static java.util.Set<java.lang.String> |
resolveVariableReferences(java.util.Properties props)
Supports property values having variable references.
|
public static java.util.Set<java.lang.String> resolveVariableReferences(java.util.Properties props)
Properties can have variables of the syntax ${variable-name}. Variables are resolved in the following sequence:
Example: Propertires config.file=${user.dir}/foo.xml. First, if the properties object has a definition for 'user.dir' it is used. Otherwise, System.getProperty('user.dir') is used. Null is used and a warning generated if the variable isn't defined. In this case, if the user.dir is '/home/dashmore', the property value will be converted to '/home/dashmore/foo.xml'.
props
- protected static java.util.Set<java.lang.String> findSettingsNeedingResolution(java.util.Properties props)
protected static java.util.Set<java.lang.String> findReferencedVariableNames(java.lang.String value, int beginningOffset)
protected static java.lang.String replaceVariableWithValue(java.lang.String variableName, java.lang.String variableValue, java.lang.String baseString)
Copyright © 2015 The Admin4J Project. All Rights Reserved.