if (visitor.shouldVisit(name, definedIn)) {
Object value = readMethod.invoke(object, new Object[0]);
visitor.visit(name, property.getPropertyType(), definedIn, value);
}
} catch (IllegalArgumentException e) {
throw new ObjectAccessException("Could not get property "
+ object.getClass() + "." + property.getName(), e);
} catch (IllegalAccessException e) {
throw new ObjectAccessException("Could not get property "
+ object.getClass() + "." + property.getName(), e);
} catch (InvocationTargetException e) {
throw new ObjectAccessException("Could not get property "
+ object.getClass() + "." + property.getName(), e);
}
}
}