Reflecting
Reflecting a method by name (will return null if not found):
Class clazz;
Method m = new Mirror().on(clazz).reflect().method("methodName").withoutArgs();
Reflect a method by arguments (will return null if not found):
Class clazz;
Method m = new Mirror().on(clazz).reflect().method("methodName")
.withArgs(String.class, Object.class);
Reflecting all methods of a class (will return an empty list if none found):
Class clazz;
List<Method> l = new Mirror().on(clazz).reflectAll().methods();
Reflecting all getters of a class (will return an empty list if none found):
Class clazz;
List<Method> l = new Mirror().on(clazz).reflectAll().getters();
Reflecting all setters of a class (will return an empty list if none found):
Class clazz;
List<Method> l = new Mirror().on(clazz).reflectAll().setters();
Reflecting all methods of class that matches a Matcher<Method> (will return an empty list if none found):
Class clazz;
List<Method> l = new Mirror().on(clazz).reflectAll()
.methodsMatching(new YourCustomMatcher());