Class PropertyUtil


  • public class PropertyUtil
    extends java.lang.Object
    expands nested property references within a provided string
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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, java.util.Properties properties)
      expand a keyString that may contain references to properties located in provided Properties object
      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.util.Properties expand​(java.util.Map properties)
      expand a given Properties object and return a new one.
      • 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.
        Parameters:
        properties - input
        Returns:
        properties
      • 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
        Parameters:
        keyString - string
        properties - properties
        Returns:
        expanded
      • 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
        Parameters:
        keyString - string
        properties - properties
        Returns:
        expanded
      • 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