private static String stripEnvironmentPrefix ( final String key ) { if ( key . indexOf ( ' ' ) < 0 ) return key ; final String prefix = key . substring ( 0 , key . indexOf ( ' ' ) ) ; if ( ! prefix . toUpperCase ( ) . equals ( prefix ) ) return key ; final String newKey = key . substring ( prefix . length ( ) + 1 ) ; final String value = PropertyManager . getProperty ( newKey ) ; if ( value == null ) return key ; return newKey ; }
Looks at the prefix of the key up to the first period . If it is UPPERCASE strips it off then checks to see the PM has a value for that key in the current environment . If null returns the original key if there s a value returns the key with the prefix removed . If there is not an uppercase prefix returns the original key .