ModelMapper icon indicating copy to clipboard operation
ModelMapper copied to clipboard

Missing springframework dependency

Open arreche opened this issue 10 years ago • 3 comments

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?

arreche avatar Jun 14 '14 14:06 arreche

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 :)

tejada avatar Nov 14 '14 10:11 tejada

Great project !

Is there a way to serialize the object to a json?

loverxp avatar Dec 10 '14 07:12 loverxp

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.

loverxp avatar Dec 10 '14 09:12 loverxp