@Test public void testGetParameterClasses() { assertEquals(0, ServiceMethodTranslator.getParameterClasses(methodsArray[0]).length); assertEquals(1, ServiceMethodTranslator.getParameterClasses(methodsArray[1]).length); assertEquals(2, ServiceMethodTranslator.getParameterClasses(methodsArray[2]).length); assertEquals(3, ServiceMethodTranslator.getParameterClasses(methodsArray[3]).length); }
public static Class [] getParameterClasses(String methodName) { Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); String paramTypes [] = getMethodParameterTypes(methodName); Class paramClasses [] = new Class [paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { try { if (arrayContains(JAVA_PRIMITIVES, paramTypes[i])) { paramClasses[i] = getPrimitiveClass(paramTypes[i]); } else if (arrayContains(JAVA_LANG_CLASSES, paramTypes[i])) { paramClasses[i] = Class.forName(JAVA_LANG_PREFIX + paramTypes[i]); } else { paramClasses[i] = Class.forName(paramTypes[i]); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return paramClasses; }
ServiceMethodTranslator { public static Class [] getParameterClasses(String methodName) { Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); String paramTypes [] = getMethodParameterTypes(methodName); Class paramClasses [] = new Class [paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { try { if (arrayContains(JAVA_PRIMITIVES, paramTypes[i])) { paramClasses[i] = getPrimitiveClass(paramTypes[i]); } else if (arrayContains(JAVA_LANG_CLASSES, paramTypes[i])) { paramClasses[i] = Class.forName(JAVA_LANG_PREFIX + paramTypes[i]); } else { paramClasses[i] = Class.forName(paramTypes[i]); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return paramClasses; } }
ServiceMethodTranslator { public static Class [] getParameterClasses(String methodName) { Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); String paramTypes [] = getMethodParameterTypes(methodName); Class paramClasses [] = new Class [paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { try { if (arrayContains(JAVA_PRIMITIVES, paramTypes[i])) { paramClasses[i] = getPrimitiveClass(paramTypes[i]); } else if (arrayContains(JAVA_LANG_CLASSES, paramTypes[i])) { paramClasses[i] = Class.forName(JAVA_LANG_PREFIX + paramTypes[i]); } else { paramClasses[i] = Class.forName(paramTypes[i]); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return paramClasses; }  }
ServiceMethodTranslator { public static Class [] getParameterClasses(String methodName) { Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); String paramTypes [] = getMethodParameterTypes(methodName); Class paramClasses [] = new Class [paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { try { if (arrayContains(JAVA_PRIMITIVES, paramTypes[i])) { paramClasses[i] = getPrimitiveClass(paramTypes[i]); } else if (arrayContains(JAVA_LANG_CLASSES, paramTypes[i])) { paramClasses[i] = Class.forName(JAVA_LANG_PREFIX + paramTypes[i]); } else { paramClasses[i] = Class.forName(paramTypes[i]); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return paramClasses; }  static int getMethodIndex(String [] methodsArray, String methodName); static String getMethodName(String [] methodsArray, int index); static String getMethodSignature(String [] methodsArray, int index); static int getParameterNumber(String methodName); static String getMethodParameterType(String methodName, int parameter); static String getMethodParameterTypeCapitalised(String methodName, int parameter); static String [] getMethodParameterTypesCapitalised(String methodName); static String [] getMethodParameterTypes(String methodName); static String getMethodParameterName(String methodName, int parameter); static String [] getMethodParameterNames(String methodName); static Class [] getParameterClasses(String methodName); }
ServiceMethodTranslator { public static Class [] getParameterClasses(String methodName) { Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); String paramTypes [] = getMethodParameterTypes(methodName); Class paramClasses [] = new Class [paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { try { if (arrayContains(JAVA_PRIMITIVES, paramTypes[i])) { paramClasses[i] = getPrimitiveClass(paramTypes[i]); } else if (arrayContains(JAVA_LANG_CLASSES, paramTypes[i])) { paramClasses[i] = Class.forName(JAVA_LANG_PREFIX + paramTypes[i]); } else { paramClasses[i] = Class.forName(paramTypes[i]); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return paramClasses; }  static int getMethodIndex(String [] methodsArray, String methodName); static String getMethodName(String [] methodsArray, int index); static String getMethodSignature(String [] methodsArray, int index); static int getParameterNumber(String methodName); static String getMethodParameterType(String methodName, int parameter); static String getMethodParameterTypeCapitalised(String methodName, int parameter); static String [] getMethodParameterTypesCapitalised(String methodName); static String [] getMethodParameterTypes(String methodName); static String getMethodParameterName(String methodName, int parameter); static String [] getMethodParameterNames(String methodName); static Class [] getParameterClasses(String methodName); static final String JAVA_LANG_PREFIX; static final String ANDROID_OS_PREFIX; static final String JAVA_PRIMITIVES; static final String JAVA_LANG_CLASSES; }