private static void buildClass ( StringBuilder builder , Class cls ) { int arrayDims = 0 ; Class tmp = cls ; while ( tmp . isArray ( ) ) { arrayDims ++ ; tmp = tmp . getComponentType ( ) ; } builder . append ( tmp . getName ( ) ) ; if ( arrayDims > 0 ) { for ( ; arrayDims > 0 ; arrayDims -- ) { builder . append ( "[]" ) ; } } }
Build Java code to represent a type reference to the given class .