snack3 icon indicating copy to clipboard operation
snack3 copied to clipboard

可否支持指定类型的构造器或工厂方法

Open jovezhao opened this issue 3 years ago • 10 comments

jovezhao avatar Sep 23 '21 03:09 jovezhao

只支持无参构造器一种。其它不支持。。。

noear avatar Sep 23 '21 05:09 noear

可以考虑添加一个全局配置项,可以指定根据类型创建实例的方式。

jovezhao avatar Sep 23 '21 11:09 jovezhao

这个建议好的!

发自我的iPhone

在 2021年9月23日,下午7:06,jovezhao @.***> 写道:



可以考虑添加一个全局配置项,可以指定根据类型创建实例的方式。

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/noear/snack3/issues/11#issuecomment-925711850, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAW23S622KUEYY5CDYDQ66TUDMCZXANCNFSM5ESWY4EA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

noear avatar Sep 23 '21 11:09 noear

可以加到qq群里。。。方便后续交流

noear avatar Sep 23 '21 14:09 noear

早就不用QQ了

jovezhao avatar Sep 24 '21 01:09 jovezhao

https://github.com/noear/snack3/blob/master/snack3_demo/src/test/java/features/Coding.java

这个单测看一下。可以支持了。

noear avatar Oct 12 '21 04:10 noear

看了单测,这个没有解决类型构造的问题,只解决了自定义类型映射。

jovezhao avatar Oct 14 '21 09:10 jovezhao

自定义解码时,可以在里面new 。。。相当于构造了。。。

发自我的iPhone

在 2021年10月14日,下午5:47,jovezhao @.***> 写道:



看了单测,这个没有解决类型构造的问题,只解决了自定义类型映射。

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/noear/snack3/issues/11#issuecomment-943194825, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAW23S75NVGETKFOLPIOUFTUG2RKVANCNFSM5ESWY4EA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

noear avatar Oct 14 '21 11:10 noear

只需要构造,构造完了,还要使用默认的方式吧json中的值写入实例属性

jovezhao avatar Oct 14 '21 11:10 jovezhao

我想想想啊。最好两者共用机制

发自我的iPhone

在 2021年10月14日,下午7:22,jovezhao @.***> 写道:



只需要构造,构造完了,还要使用默认的方式吧json中的值写入实例属性

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/noear/snack3/issues/11#issuecomment-943263655, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAW23S72X66ND2JL5DJM7LDUG24ONANCNFSM5ESWY4EA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

noear avatar Oct 14 '21 11:10 noear