public class InterpolationHelper extends Object
Enhancement of the standard Properties
managing the maintain of comments, etc.
Modifier and Type | Class and Description |
---|---|
static interface |
InterpolationHelper.SubstitutionCallback
Callback for substitution
|
Modifier and Type | Method and Description |
---|---|
static void |
performSubstitution(Map<String,String> properties)
Perform substitution on a property set
|
static void |
performSubstitution(Map<String,String> properties,
org.osgi.framework.BundleContext context)
Perform substitution on a property set
|
static void |
performSubstitution(Map<String,String> properties,
InterpolationHelper.SubstitutionCallback callback)
Perform substitution on a property set
|
static String |
substVars(String val,
String currentKey,
Map<String,String> cycleMap,
Map<String,String> configProps,
org.osgi.framework.BundleContext context)
This method performs property variable substitution on the
specified value.
|
static String |
substVars(String val,
String currentKey,
Map<String,String> cycleMap,
Map<String,String> configProps,
InterpolationHelper.SubstitutionCallback callback)
This method performs property variable substitution on the
specified value.
|
public static void performSubstitution(Map<String,String> properties)
properties
- the property set to perform substitution onpublic static void performSubstitution(Map<String,String> properties, org.osgi.framework.BundleContext context)
properties
- the property set to perform substitution onpublic static void performSubstitution(Map<String,String> properties, InterpolationHelper.SubstitutionCallback callback)
properties
- the property set to perform substitution onpublic static String substVars(String val, String currentKey, Map<String,String> cycleMap, Map<String,String> configProps, org.osgi.framework.BundleContext context) throws IllegalArgumentException
This method performs property variable substitution on the specified value. If the specified value contains the syntax ${<prop-name>}, where <prop-name> refers to either a configuration property or a system property, then the corresponding property value is substituted for the variable placeholder. Multiple variable placeholders may exist in the specified value as well as nested variable placeholders, which are substituted from inner most to outer most. Configuration properties override system properties.
val
- The string on which to perform property substitution.currentKey
- The key of the property being evaluated used to
detect cycles.cycleMap
- Map of variable references used to detect nested cycles.configProps
- Set of configuration properties.context
- the bundle context to retrieve properties fromIllegalArgumentException
- If there was a syntax error in the
property placeholder syntax or a recursive variable reference.public static String substVars(String val, String currentKey, Map<String,String> cycleMap, Map<String,String> configProps, InterpolationHelper.SubstitutionCallback callback) throws IllegalArgumentException
This method performs property variable substitution on the specified value. If the specified value contains the syntax ${<prop-name>}, where <prop-name> refers to either a configuration property or a system property, then the corresponding property value is substituted for the variable placeholder. Multiple variable placeholders may exist in the specified value as well as nested variable placeholders, which are substituted from inner most to outer most. Configuration properties override system properties.
val
- The string on which to perform property substitution.currentKey
- The key of the property being evaluated used to
detect cycles.cycleMap
- Map of variable references used to detect nested cycles.configProps
- Set of configuration properties.callback
- the callback to obtain substitution valuesIllegalArgumentException
- If there was a syntax error in the
property placeholder syntax or a recursive variable reference.Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.