public Map < String , String > getEnvProperty ( ) { Map < String , String > res = new TreeMap < String , String > ( ) ; MutablePropertySources mps = env . getPropertySources ( ) ; Iterator < PropertySource < ? > > iter = mps . iterator ( ) ; while ( iter . hasNext ( ) ) { PropertySource < ? > ps = iter . next ( ) ; if ( ps instanceof EnumerablePropertySource < ? > ) { for ( String propName : ( ( EnumerablePropertySource < ? > ) ps ) . getPropertyNames ( ) ) { try { res . put ( propName , env . getProperty ( propName ) ) ; } catch ( Exception e ) { LOGGER . warn ( "unresolveable property: " + propName ) ; res . put ( propName , "UNRESOLVEABLE" ) ; } } } } return res ; }
returns the spring environment properties