private static void getDescriptor ( final StringBuffer buf , final Class < ? > c ) { Class < ? > d = c ; while ( true ) { if ( d . isPrimitive ( ) ) { char car ; if ( d == Integer . TYPE ) { car = ' ' ; } else if ( d == Void . TYPE ) { car = ' ' ; } else if ( d == Boolean . TYPE ) { car = ' ' ; } else if ( d == Byte . TYPE ) { car = ' ' ; } else if ( d == Character . TYPE ) { car = ' ' ; } else if ( d == Short . TYPE ) { car = ' ' ; } else if ( d == Double . TYPE ) { car = ' ' ; } else if ( d == Float . TYPE ) { car = ' ' ; } else /* if (d == Long.TYPE) */ { car = ' ' ; } buf . append ( car ) ; return ; } else if ( d . isArray ( ) ) { buf . append ( ' ' ) ; d = d . getComponentType ( ) ; } else { buf . append ( ' ' ) ; String name = d . getName ( ) ; int len = name . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { char car = name . charAt ( i ) ; buf . append ( car == ' ' ? ' ' : car ) ; } buf . append ( ' ' ) ; return ; } } }
Appends the descriptor of the given class to the given string buffer .