public static Method findAMethod(Class<?> clazz, String methodName) throws NoSuchMethodException { StringTokenizer tokenizer = new StringTokenizer(methodName, "("); String m = tokenizer.nextToken(); Method result; // If tokenizer has more elements, it mean that parameters may have been // specified if (tokenizer.hasMoreElements()) { StringTokenizer tokens = new StringTokenizer(tokenizer.nextToken(), ")"); String params = (tokens.hasMoreTokens() ? tokens.nextToken() : null); result = findMethodWithParam(clazz, m, params); } else { result = findMethod(clazz, methodName); } if (result == null) { throw new NoSuchMethodException(clazz.getName() + "." + methodName); } return result; }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }
public static Method findAMethod(Class<?> clazz, String methodName) throws NoSuchMethodException { StringTokenizer tokenizer = new StringTokenizer(methodName, "("); String m = tokenizer.nextToken(); Method result; // If tokenizer has more elements, it mean that parameters may have been // specified if (tokenizer.hasMoreElements()) { StringTokenizer tokens = new StringTokenizer(tokenizer.nextToken(), ")"); String params = (tokens.hasMoreTokens() ? tokens.nextToken() : null); result = findMethodWithParam(clazz, m, params); } else { result = findMethod(clazz, methodName); } if (result == null) { throw new NoSuchMethodException(clazz.getName() + "." + methodName); } return result; }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }
/** * Find a method with concrete string representation of it's parameters * @param clazz clazz to search * @param methodName name of method with representation of it's parameters * @return found method * @throws NoSuchMethodException */ public static Method findAMethod(Class<?> clazz, String methodName) throws NoSuchMethodException { StringTokenizer tokenizer = new StringTokenizer(methodName, "("); String m = tokenizer.nextToken(); Method result; // If tokenizer has more elements, it mean that parameters may have been specified if (tokenizer.hasMoreElements()) { StringTokenizer tokens = new StringTokenizer(tokenizer.nextToken(), ")"); String params = (tokens.hasMoreTokens() ? tokens.nextToken() : null); result = findMethodWithParam(clazz, m, params); } else { result = findMethod(clazz, methodName); } if (result == null) { throw new NoSuchMethodException(clazz.getName() + "." + methodName); } return result; }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }