it all starts with a Class object, which is returned from an object using the getClass() method. from there, you can inspect the methods in the class. the following code will get you started. note that you need to import java.lang.reflect.Method
Class clazz = obj.getClass();
for(Method method: clazz.getDeclaredMethods()) {
if ( method.getName().startsWith("get")) {
// handle that situation
}
if ( method.getName().startsWith("set")) {
// handle that situation
}
}