java.lang.Object
cn.wjybxx.dsoncodec.DynamicCodecRegistry
- 所有已实现的接口:
DsonCodecRegistry
动态Codec注册表
- 作者:
- wjybxx date - 2024/9/25
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getDecoder(cn.wjybxx.base.TypeInfo type) 查找解码器(decoder)。getEncoder(cn.wjybxx.base.TypeInfo type) 查找编码器(encoder)。
-
构造器详细资料
-
DynamicCodecRegistry
-
-
方法详细资料
-
getEncoder
从接口复制的说明:DsonCodecRegistry查找编码器(encoder)。1.可以返回超类的codec,因为子类实例可以向上转型,但子类特殊数据将被丢弃。 2.不可返回子类的codec,因为超类实例不能向下转型。
PS:可参考集合和字典的Codec实现。
- 指定者:
getEncoder在接口中DsonCodecRegistry- 参数:
type- 类型信息,含泛型参数
-
getDecoder
从接口复制的说明:DsonCodecRegistry查找解码器(decoder)。1.可以返回子类的Codec,如果子类和当前类数据兼容。 2.不可向上转型,因为超类Codec创建的实例不能安全向下转型。 3.如果可以,请尽量返回当前类对应的Codec,以避免错误。
PS:可参考集合和字典的Codec实现。
- 指定者:
getDecoder在接口中DsonCodecRegistry- 参数:
type- 类型信息,含泛型参数
-