private Tuple < String , String > getEntry ( final String key , final Collection < String > prefixes ) { if ( CollectionUtils . isEmpty ( prefixes ) ) { return getEntry ( key ) ; } for ( String prefix : prefixes ) { String prefixedKey = prefix + "." + key ; Tuple < String , String > override = getOverrideEntry ( prefixedKey ) ; if ( override != null ) { return override ; } // // Above we were checking overrides of the override. Here, // just check for the first override. If that doesn't work, // then we need to just pass it on and ignore the specified override. // String value = getPropertyValue ( prefixedKey ) ; if ( value != null ) { return new Tuple < String , String > ( prefixedKey , value ) ; } } // // No prefixed overrides were found, so drop back to using // the standard, non-prefixed version // return getEntry ( key ) ; }
Searches for a property of key with all overrides using the specified prefixes