private static void _validateConfigurationHierarchy ( @ Nonnull final Configuration aConfig ) { final ICommonsSet < String > aHierarchySet = new CommonsHashSet <> ( ) ; for ( final Configuration aSubConfig : aConfig . getSubConfigurations ( ) ) { final String sHierarchy = aSubConfig . getHierarchy ( ) ; if ( ! aHierarchySet . add ( sHierarchy ) ) throw new IllegalArgumentException ( "Configuration for " + aConfig . getHierarchy ( ) + " contains multiple SubConfigurations with the same hierarchy id '" + sHierarchy + "'. " ) ; } for ( final Configuration aSubConfig : aConfig . getSubConfigurations ( ) ) _validateConfigurationHierarchy ( aSubConfig ) ; }
Validates the content of the provided configuration by checking for multiple hierarchy entries within one configuration . It traverses down the configuration tree .