private List<String> getShimConfigProperties( String property ) { List<String> shimConfigProperties = new ArrayList<String>(); for ( String config : getShimConfigs() ) { shimConfigProperties.add( super.getProperty( config + "." + property ) ); } return shimConfigProperties; }
/** * Returns a map of key -> value of all shim properties with the given prefix (the prefix is removed) * * @param prefix the prefix to look for * @return a map of key -> value of all shim properties with the given prefix (the prefix is removed) */ public Map<String, String> getPrefixedProperties( String prefix ) { List<String> propertyPrefixes = new ArrayList<String>(); propertyPrefixes.add( prefix + "." ); for ( String shimConfig : getShimConfigs() ) { propertyPrefixes.add( shimConfig + "." + prefix.trim() + "." ); } Map<String, String> prefixedProperties = new HashMap<String, String>(); for ( String currentPrefix : propertyPrefixes ) { for ( String propertyName : stringPropertyNames() ) { if ( propertyName.startsWith( currentPrefix ) ) { prefixedProperties.put( propertyName.substring( currentPrefix.length() ), super.getProperty( propertyName ) ); } } } return prefixedProperties; } }