use of org.simpleflatmapper.reflect.meta.FieldAndMethodCallBack in project SimpleFlatMapper by arnaudroger.
the class ParamNameDeductor method listAccessors.
private List<Accessor<T>> listAccessors() {
final List<Accessor<T>> list = new ArrayList<Accessor<T>>();
ClassVisitor.visit(target, new FieldAndMethodCallBack() {
ObjectGetterFactory objectGetterFactory = new ObjectGetterFactory(null);
@Override
public void method(Method method) {
if (GetterHelper.isGetter(method)) {
Getter<T, Object> methodGetter = objectGetterFactory.getMethodGetter(method);
list.add(new Accessor<T>(GetterHelper.getPropertyNameFromMethodName(method.getName()), methodGetter));
}
}
@Override
public void field(Field field) {
Getter<T, Object> fieldGetter = objectGetterFactory.getFieldGetter(field);
list.add(new Accessor<T>(field.getName(), fieldGetter));
}
});
return list;
}
Aggregations