/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class<?> getType(String desc) { Class<?>[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class<?>[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
private static Class[] getClassType(String desc, int descLen, int start, int num) { int end = start; while (desc.charAt(end) == '[') ++end; if (desc.charAt(end) == 'L') { end = desc.indexOf(';', end); if (end < 0) throw new IndexOutOfBoundsException("bad descriptor"); } String cname; if (desc.charAt(start) == 'L') cname = desc.substring(start + 1, end); else cname = desc.substring(start, end + 1); Class[] result = getType(desc, descLen, end + 1, num + 1); try { result[num] = getClassObject(cname.replace('/', '.')); } catch (ClassNotFoundException e) { // "new RuntimeException(e)" is not available in JDK 1.3. throw new RuntimeException(e.getMessage()); } return result; } }
Class[] result = getType(desc, descLen, start + 1, num + 1); result[num] = clazz; return result;
private static Class<?>[] getClassType(String desc, int descLen, int start, int num) { int end = start; while (desc.charAt(end) == '[') ++end; if (desc.charAt(end) == 'L') { end = desc.indexOf(';', end); if (end < 0) throw new IndexOutOfBoundsException("bad descriptor"); } String cname; if (desc.charAt(start) == 'L') cname = desc.substring(start + 1, end); else cname = desc.substring(start, end + 1); Class<?>[] result = getType(desc, descLen, end + 1, num + 1); try { result[num] = getClassObject(cname.replace('/', '.')); } catch (ClassNotFoundException e) { // "new RuntimeException(e)" is not available in JDK 1.3. throw new RuntimeException(e.getMessage()); } return result; } }
Class<?>[] result = getType(desc, descLen, start + 1, num + 1); result[num] = clazz; return result;
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor. * It is used for implementing <code>$type</code>. */ public static Class getType(String desc) { Class[] result = getType(desc, desc.length(), 0, 0); if (result == null || result.length != 1) throw new RuntimeException("$type: internal error"); return result[0]; }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
/** * Interprets the given type descriptor representing a method * signature. It is used for implementing <code>$sig</code>. */ public static Class[] getParams(String desc) { if (desc.charAt(0) != '(') throw new RuntimeException("$sig: internal error"); return getType(desc, desc.length(), 1, 0); }
private static Class[] getClassType(String desc, int descLen, int start, int num) { int end = start; while (desc.charAt(end) == '[') ++end; if (desc.charAt(end) == 'L') { end = desc.indexOf(';', end); if (end < 0) throw new IndexOutOfBoundsException("bad descriptor"); } String cname; if (desc.charAt(start) == 'L') cname = desc.substring(start + 1, end); else cname = desc.substring(start, end + 1); Class[] result = getType(desc, descLen, end + 1, num + 1); try { result[num] = getClassObject(cname.replace('/', '.')); } catch (ClassNotFoundException e) { // "new RuntimeException(e)" is not available in JDK 1.3. throw new RuntimeException(e.getMessage()); } return result; } }
private static Class[] getClassType(String desc, int descLen, int start, int num) { int end = start; while (desc.charAt(end) == '[') ++end; if (desc.charAt(end) == 'L') { end = desc.indexOf(';', end); if (end < 0) throw new IndexOutOfBoundsException("bad descriptor"); } String cname; if (desc.charAt(start) == 'L') cname = desc.substring(start + 1, end); else cname = desc.substring(start, end + 1); Class[] result = getType(desc, descLen, end + 1, num + 1); try { result[num] = getClassObject(cname.replace('/', '.')); } catch (ClassNotFoundException e) { // "new RuntimeException(e)" is not available in JDK 1.3. throw new RuntimeException(e.getMessage()); } return result; } }