com.dtolabs.rundeck.core.utils
Class PropertyUtil

java.lang.Object
  extended by com.dtolabs.rundeck.core.utils.PropertyUtil

public class PropertyUtil
extends java.lang.Object

expands nested property references within a provided string


Nested Class Summary
static class PropertyUtil.PropertyUtilException
           
 
Constructor Summary
PropertyUtil()
           
 
Method Summary
static java.util.Properties expand(java.util.Map properties)
          expand a given Properties object and return a new one.
static java.lang.String expand(java.lang.String keyString, java.util.Map properties)
          expand a keyString that may contain references other properties located in provided Map object NOTE: this is a recursive method in case references to properties are nested within another reference
static java.lang.String expand(java.lang.String keyString, org.apache.tools.ant.Project project)
          expand a keyString that may contain referecnes to other properties
static java.lang.String expand(java.lang.String keyString, java.util.Properties properties)
          expand a keyString that may contain references to properties located in provided Properties object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtil

public PropertyUtil()
Method Detail

expand

public static java.util.Properties expand(java.util.Map properties)
expand a given Properties object and return a new one. This will process each key to a given Properties object, get its value and expand it. Each value may contain references to other keys within this given Properties object, and if so, all keys and their expanded keyValues will be resolved into a new Properties object that will be returned.


expand

public static java.lang.String expand(java.lang.String keyString,
                                      java.util.Properties properties)
expand a keyString that may contain references to properties located in provided Properties object


expand

public static java.lang.String expand(java.lang.String keyString,
                                      java.util.Map properties)
expand a keyString that may contain references other properties located in provided Map object NOTE: this is a recursive method in case references to properties are nested within another reference


expand

public static java.lang.String expand(java.lang.String keyString,
                                      org.apache.tools.ant.Project project)
expand a keyString that may contain referecnes to other properties

Parameters:
keyString - string containing props
project - Ant project
Returns:
expanded string