public SortedMap < String , Class < ? > > getClassesMap ( Package ... packages ) { SortedMap < String , Class < ? > > answer = new TreeMap < String , Class < ? > > ( ) ; Map < String , ClassResource > urlSet = new HashMap < String , ClassResource > ( ) ; for ( Package aPackage : packages ) { addPackageResources ( aPackage , urlSet , classLoaders ) ; } for ( ClassResource classResource : urlSet . values ( ) ) { Set < Class < ? > > classes = getClassesForPackage ( classResource , null , null ) ; for ( Class < ? > aClass : classes ) { answer . put ( aClass . getName ( ) , aClass ) ; } } return answer ; }
Returns all the classes found in a sorted map for the given list of packages