-
@Documented @Target(TYPE) @Retention(RUNTIME) public @interface ConvertImpl
用于序列化时接口或抽象类的默认实现类, 被标记的类必须是接口或抽象类
使用场景:
@ConvertImpl(OneImpl.class) public interface OneEntity { public String getName(); } public class OneImpl implements OneEntity { private String name; public String getName(){return name;} public void setName(String name){this.name=name;} } String json = "{'name':'hello'}"; OneEntity one = JsonConvert.root().convertFrom(OneEntity.class, json); //one instanceof OneImpl
详情见: https://redkale.org
- 从以下版本开始:
- 2.5.0
- 作者:
- zhangjx