/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @param capitalizeFirstChar set to true if first character needs to be capitalized, false if not. * @return camel case version of underscore. */ public static String camelize(String underscore, boolean capitalizeFirstChar){ StringBuilder result = new StringBuilder(); StringTokenizer st = new StringTokenizer(underscore, "_"); while (st.hasMoreTokens()) { result.append(capitalize(st.nextToken())); } return capitalizeFirstChar ? result.toString() : result.substring(0, 1).toLowerCase() + result.substring(1); }
String methodName1 = "is" + capitalize(booleanMethod); String methodName2 = "has" + capitalize(booleanMethod); Method m = booleanMethodNamed(booleanMethod); if (m == null) {
/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @param capitalizeFirstChar set to true if first character needs to be capitalized, false if not. * @return camel case version of underscore. */ public static String camelize(String underscore, boolean capitalizeFirstChar){ StringBuilder result = new StringBuilder(); StringTokenizer st = new StringTokenizer(underscore, "_"); while (st.hasMoreTokens()) { result.append(capitalize(st.nextToken())); } return capitalizeFirstChar ? result.toString() : result.substring(0, 1).toLowerCase() + result.substring(1); }
/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @param capitalizeFirstChar set to true if first character needs to be capitalized, false if not. * @return camel case version of underscore. */ public static String camelize(String underscore, boolean capitalizeFirstChar){ StringBuilder result = new StringBuilder(); StringTokenizer st = new StringTokenizer(underscore, "_"); while (st.hasMoreTokens()) { result.append(capitalize(st.nextToken())); } return capitalizeFirstChar ? result.toString() : result.substring(0, 1).toLowerCase() + result.substring(1); }
String methodName1 = "is" + capitalize(booleanMethod); String methodName2 = "has" + capitalize(booleanMethod); Method m = booleanMethodNamed(booleanMethod); if (m == null) {
String methodName1 = "is" + capitalize(booleanMethod); String methodName2 = "has" + capitalize(booleanMethod); Method m = booleanMethodNamed(booleanMethod); if (m == null) {
Method m = obj.getClass().getMethod("get" + capitalize(propertyName)); val = m.invoke(obj); } catch (NoSuchMethodException ignore) {