@Test public void testGetMethodParameterType() { assertEquals(PARAM_1_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[1], 0)); assertEquals(PARAM_1_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[2], 0)); assertEquals(PARAM_2_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[2], 1)); assertEquals(PARAM_1_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[3], 0)); assertEquals(PARAM_2_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[3], 1)); assertEquals(PARAM_10_TYPE, ServiceMethodTranslator.getMethodParameterType(methodsArray[3], 2)); assertEquals(null, ServiceMethodTranslator.getMethodParameterType(methodsArray[0], 0)); }
public static String getMethodParameterType(String methodName, int parameter) { 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)); Dbc.require("Method index must be 0 or greater", parameter >= 0); String retValue = null; String paramTypes [] = getMethodParameterTypes(methodName); if (paramTypes.length > 0 && parameter < paramTypes.length) { retValue = paramTypes[parameter]; } return retValue; }
ServiceMethodTranslator { public static String getMethodParameterType(String methodName, int parameter) { 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)); Dbc.require("Method index must be 0 or greater", parameter >= 0); String retValue = null; String paramTypes [] = getMethodParameterTypes(methodName); if (paramTypes.length > 0 && parameter < paramTypes.length) { retValue = paramTypes[parameter]; } return retValue; } }
ServiceMethodTranslator { public static String getMethodParameterType(String methodName, int parameter) { 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)); Dbc.require("Method index must be 0 or greater", parameter >= 0); String retValue = null; String paramTypes [] = getMethodParameterTypes(methodName); if (paramTypes.length > 0 && parameter < paramTypes.length) { retValue = paramTypes[parameter]; } return retValue; }  }
ServiceMethodTranslator { public static String getMethodParameterType(String methodName, int parameter) { 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)); Dbc.require("Method index must be 0 or greater", parameter >= 0); String retValue = null; String paramTypes [] = getMethodParameterTypes(methodName); if (paramTypes.length > 0 && parameter < paramTypes.length) { retValue = paramTypes[parameter]; } return retValue; }  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 String getMethodParameterType(String methodName, int parameter) { 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)); Dbc.require("Method index must be 0 or greater", parameter >= 0); String retValue = null; String paramTypes [] = getMethodParameterTypes(methodName); if (paramTypes.length > 0 && parameter < paramTypes.length) { retValue = paramTypes[parameter]; } return retValue; }  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; }