@Test(expected=NoSuchMethodException.class) public void getBeanMethodsOnlyGet() throws Exception { Method[] methods = ClassUtil.getBeanMethods(InternetPerson.class, "email2", String.class, false); }
public static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive) throws IllegalAccessException, NoSuchMethodException { Method methods[] = new Method[2]; methods[0] = getMethod(type, "get"+propertyName, propertyType, null, caseSensitive); methods[1] = getMethod(type, "set"+propertyName, null, propertyType, caseSensitive); return methods; }
ClassUtil { public static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive) throws IllegalAccessException, NoSuchMethodException { Method methods[] = new Method[2]; methods[0] = getMethod(type, "get"+propertyName, propertyType, null, caseSensitive); methods[1] = getMethod(type, "set"+propertyName, null, propertyType, caseSensitive); return methods; } }
ClassUtil { public static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive) throws IllegalAccessException, NoSuchMethodException { Method methods[] = new Method[2]; methods[0] = getMethod(type, "get"+propertyName, propertyType, null, caseSensitive); methods[1] = getMethod(type, "set"+propertyName, null, propertyType, caseSensitive); return methods; }  }
ClassUtil { public static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive) throws IllegalAccessException, NoSuchMethodException { Method methods[] = new Method[2]; methods[0] = getMethod(type, "get"+propertyName, propertyType, null, caseSensitive); methods[1] = getMethod(type, "set"+propertyName, null, propertyType, caseSensitive); return methods; }  static Object findEnumConstant(Class<?> type, String constantName); static Object findEnumConstant(Class<?> type, String constantName, boolean caseSensitive); static Class<?>[] getClassHierarchy(Class<?> type); static boolean hasBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive); static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive); static Method getMethod(Class<?> type, String name, Class<?> returnType, Class<?> paramType, boolean caseSensitive); }
ClassUtil { public static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive) throws IllegalAccessException, NoSuchMethodException { Method methods[] = new Method[2]; methods[0] = getMethod(type, "get"+propertyName, propertyType, null, caseSensitive); methods[1] = getMethod(type, "set"+propertyName, null, propertyType, caseSensitive); return methods; }  static Object findEnumConstant(Class<?> type, String constantName); static Object findEnumConstant(Class<?> type, String constantName, boolean caseSensitive); static Class<?>[] getClassHierarchy(Class<?> type); static boolean hasBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive); static Method[] getBeanMethods(Class<?> type, String propertyName, Class<?> propertyType, boolean caseSensitive); static Method getMethod(Class<?> type, String name, Class<?> returnType, Class<?> paramType, boolean caseSensitive);  }