Skip to content

Commit

Permalink
minor cleanup for pull request #65
Browse files Browse the repository at this point in the history
  • Loading branch information
jussimalinen committed Apr 16, 2015
1 parent fb0210b commit 270f088
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,27 @@ public void scrollComponentToView(String identifier) {
public String[] listComponentMethods(String identifier) {
Class klass = operator(identifier).getSource().getClass();
ArrayList<String> list = new ArrayList<String>();

for (Method m : klass.getMethods()) {
String entry = "";
entry += m.getReturnType().getName() + " ";
entry += m.getName();
entry += "(";
Class[] args = m.getParameterTypes();
for (int i = 0; i < args.length; i++) {
entry += args[i].getName();
if (i != args.length - 1)
entry += ", ";
}
entry += ")";
String entry = getMethodDescription(m);
System.out.println(entry);
list.add(entry);
}
return list.toArray(new String[list.size()]);
}

private String getMethodDescription(Method m) {
String entry = m.getReturnType().getName() + " ";
entry += m.getName();
entry += "(";
Class[] args = m.getParameterTypes();
for (int i = 0; i < args.length; i++) {
entry += args[i].getName();
if (i != args.length - 1)
entry += ", ";
}
return entry + ")";
}

private Method getMethodByNameAndArgumentCount(Class klass, String name, int argCount) {
for (Method m : klass.getMethods()) {
if (m.getName().equals(name) && m.getParameterTypes().length == argCount)
Expand Down

0 comments on commit 270f088

Please sign in to comment.