ModelMapper
ModelMapper copied to clipboard
Missing springframework dependency
ModelMapper.getInstance().generate(User.class, json);
does not compile.
I think because public class InvalidCallbackMethodException extends org.springframework.http.converter.HttpMessageNotReadableException
Which is in compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
Would be possible to use ModelMapper
without any spring dependency?
Hi, you must add this two jar libraries to your project:
spring-android-core-1.0.1.RELEASE.jar spring-android-rest-template-1.0.1.RELEASE.jar
I hope it solves your problems :)
Great project !
Is there a way to serialize the object to a json?
A little of improvment:
ArrayList<FieldInfo> fields = new ArrayList<FieldInfo>();
if (!Object.class.equals(clazz.getSuperclass())) {
fields.addAll(getFieldsInClass(clazz.getSuperclass()));
}
Field[] declaredFields = clazz.getDeclaredFields();
after adding the codes above, fields of super class is supported.