Here you can find the source of typeToTyperef(Class type)
public static String typeToTyperef(Class type)
//package com.java2s; public class Main { /**//from w ww . j a v a2 s.c o m * Converts type to type ref. */ public static String typeToTyperef(Class type) { if (type.isArray() == false) { if (type.isPrimitive() == false) { return 'L' + typeToSignature(type) + ';'; } if (type == int.class) { return "I"; } if (type == long.class) { return "J"; } if (type == boolean.class) { return "Z"; } if (type == double.class) { return "D"; } if (type == float.class) { return "F"; } if (type == short.class) { return "S"; } if (type == void.class) { return "V"; } if (type == byte.class) { return "B"; } if (type == char.class) { return "C"; } } return type.getName(); } /** * Converts class name ("foo.Bar") to signature ("foo/bar"). */ public static String typeToSignature(String className) { return className.replace('.', '/'); } /** * Converts class name ("foo.Bar") to asm name ("foo/bar"). */ public static String typeToSignature(Class type) { return type.getName().replace('.', '/'); } }