public static HierarchicalConfiguration getHierarchicalConfiguration ( final Configuration configuration ) { if ( configuration instanceof CompositeConfiguration ) { final CompositeConfiguration compositeConfig = ( CompositeConfiguration ) configuration ; for ( int i = 0 ; i < compositeConfig . getNumberOfConfigurations ( ) ; i ++ ) { if ( compositeConfig . getConfiguration ( i ) instanceof HierarchicalConfiguration ) { return ( HierarchicalConfiguration ) compositeConfig . getConfiguration ( i ) ; } } } // maybe I need to send a runtime exception ?? // throw new // ConfigurationRuntimeException("no hierarchical configuration was defined"); return null ; }
returns the hierarchical part of a configuration