/** * Returns a {@link List} of {@link MethodSub}s for each * method declared method in the inspected class. However, * in safe mode (which *is* the default), this will only return * the public methods. You must configure safe mode to be off * to receive a list of all methods. * @return methods inspectors list */ public List<MethodSub> getMethods() { if (methods == null) { Method[] declared = getType().getDeclaredMethods(); List<MethodSub> subs = new ArrayList<MethodSub>(declared.length); for (Method method : declared) { MethodSub sub = new MethodSub(method); if ((!isSafeMode() || sub.isPublic()) && (showDeprecated || !sub.isDeprecated())) { subs.add(sub); } } Collections.sort(subs); methods = Collections.unmodifiableList(subs); } return methods; }
String name = getName(); switch (getParameterCount()) return uncapitalize(name.substring(3, name.length())); return uncapitalize(name.substring(2, name.length())); if (name.startsWith("set") && name.length() > 3) return uncapitalize(name.substring(3, name.length()));
for (MethodSub method : getMethods()) if (!isSafeMode() || method.isPublic()) if (!method.isVoid()) addType(types, method.getReturns()); for (Class type : method.getParameters())
/** * Returns true if the return type of this method is void. * @return <code>true</code> if the inspected method returns null */ public boolean isVoid() { return (getReturns() == Void.TYPE); }