com.darwinsys.reflection.ReflectionUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of darwinsys-api Show documentation
Show all versions of darwinsys-api Show documentation
Ian Darwin's assorted Java stuff,
assembled as an API.
package com.darwinsys.reflection;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* Get the Constructors and methods
* @author Ian F. Darwin, http://www.darwinsys.com/
*/
public class ReflectionUtils {
public List getSetters(String cName) throws ClassNotFoundException {
Class> c = Class.forName(cName);
Method[] meths = c.getMethods();
List list = new ArrayList();
for (Method m : meths) {
if (m.getName().startsWith("set")) {
list.add(m);
}
}
return list;
}
}