Class PropertyResolver


  • class PropertyResolver
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String fromPropertiesThenSystemThenEnvironment​(java.lang.String key, java.util.Properties properties, java.util.Properties environment)  
      java.lang.String getPropertyValue​(java.lang.String key, java.util.Properties properties, java.util.Properties environment)
      Retrieves a property value, replacing values like ${token} using the Properties to look them up.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyResolver

        PropertyResolver()
    • Method Detail

      • getPropertyValue

        public java.lang.String getPropertyValue​(java.lang.String key,
                                                 java.util.Properties properties,
                                                 java.util.Properties environment)
        Retrieves a property value, replacing values like ${token} using the Properties to look them up. Shamelessly adapted from: http://maven.apache.org/plugins/maven-war-plugin/xref/org/apache/maven/plugin/war/PropertyUtils.html It will leave unresolved properties alone, trying for System properties, and environment variables and implements reparsing (in the case that the value of a property contains a key), and will not loop endlessly on a pair like test = ${test}
        Parameters:
        key - property key
        properties - project properties
        environment - environment variables
        Returns:
        resolved property value
        Throws:
        java.lang.IllegalArgumentException - when properties are circularly defined
      • fromPropertiesThenSystemThenEnvironment

        private java.lang.String fromPropertiesThenSystemThenEnvironment​(java.lang.String key,
                                                                         java.util.Properties properties,
                                                                         java.util.Properties environment)