/** * Find the property names with getter methods on the target class. This method returns the property names for the methods * returned by {@link #findGetterMethods()}. * * @return the Java Bean property names for the getters; never null but possibly empty */ public String[] findGetterPropertyNames() { final Method[] getters = findGetterMethods(); final List<String> result = new ArrayList<String>(); for (int i = 0; i < getters.length; i++) { final Method m = getters[i]; String name = m.getName(); if (name.startsWith("get") && name.length() > 3) { result.add(name.substring(3)); } else if (name.startsWith("is") && name.length() > 2) { result.add(name.substring(2)); } } return result.toArray(new String[result.size()]); }