private static void describeClassTree ( Class < ? > inputClass , Set < Class < ? > > setOfClasses ) { // can't map null class if ( inputClass == null ) { return ; } // don't further analyze a class that has been analyzed already if ( Object . class . equals ( inputClass ) || setOfClasses . contains ( inputClass ) ) { return ; } // add to analysis set setOfClasses . add ( inputClass ) ; // perform super class analysis describeClassTree ( inputClass . getSuperclass ( ) , setOfClasses ) ; // perform analysis on interfaces for ( Class < ? > hasInterface : inputClass . getInterfaces ( ) ) { describeClassTree ( hasInterface , setOfClasses ) ; } }
Recursive handler for describing the set of classes while using the setOfClasses parameter as a collector