private List < Method > getExcludedMethods ( final Class < ? > cls ) { final List < Method > lst = new ArrayList < Method > ( ) ; for ( final ContractExclude exclude : cls . getAnnotationsByType ( ContractExclude . class ) ) { final Class < ? > clazz = exclude . value ( ) ; for ( final String mthdName : exclude . methods ( ) ) { try { lst . add ( clazz . getDeclaredMethod ( mthdName ) ) ; } catch ( NoSuchMethodException | SecurityException e ) { LOG . warn ( String . format ( "ContractExclude annotation on %s incorrect" , cls ) , e ) ; } } } return lst ; }
Get the ContractExclude annotation and extract the list of methods from it .