模块 org.redkale

类 ConvertFactory<R extends Reader,​W extends Writer>

  • 类型参数:
    R - Reader输入的子类
    W - Writer输出的子类
    直接已知子类:
    JsonFactory, ProtobufFactory

    public abstract class ConvertFactory<R extends Reader,​W extends Writer>
    extends Object
    序列化模块的工厂类,用于注册自定义的序列化类型,获取Convert

    详情见: https://redkale.org

    作者:
    zhangjx
    • 构造器详细资料

      • ConvertFactory

        protected ConvertFactory​(ConvertFactory<R,​W> parent,
                                 int features)
    • 方法详细资料

      • getSystemPropertyInt

        protected static int getSystemPropertyInt​(String key,
                                                  String parentkey,
                                                  boolean defvalue,
                                                  int feature)
      • getConvertType

        public abstract ConvertType getConvertType()
      • isReversible

        public abstract boolean isReversible()
      • isFieldSort

        public abstract boolean isFieldSort()
      • createChild

        public abstract ConvertFactory createChild​(int features)
      • createEnumSimpledCoder

        protected SimpledCoder createEnumSimpledCoder​(Class enumClass)
      • formatObjectType

        protected Type formatObjectType​(Type type)
      • isCollectionType

        protected boolean isCollectionType​(Type type)
      • getCollectionComponentType

        protected Type getCollectionComponentType​(Type type)
      • isStreamType

        protected boolean isStreamType​(Type type)
      • getStreamionComponentType

        protected Type getStreamionComponentType​(Type type)
      • createDyncEncoder

        protected <E> Encodeable<W,​E> createDyncEncoder​(Type type)
      • createMultiImplDecoder

        protected <E> Decodeable<R,​E> createMultiImplDecoder​(Class[] types)
      • createObjectEncoder

        protected <E> ObjectEncoder<W,​E> createObjectEncoder​(Type type)
      • createMapDecoder

        protected <E> Decodeable<R,​E> createMapDecoder​(Type type)
      • createMapEncoder

        protected <E> Encodeable<W,​E> createMapEncoder​(Type type)
      • createArrayDecoder

        protected <E> Decodeable<R,​E> createArrayDecoder​(Type type)
      • createArrayEncoder

        protected <E> Encodeable<W,​E> createArrayEncoder​(Type type)
      • createCollectionDecoder

        protected <E> Decodeable<R,​E> createCollectionDecoder​(Type type)
      • createCollectionEncoder

        protected <E> Encodeable<W,​E> createCollectionEncoder​(Type type)
      • createStreamDecoder

        protected <E> Decodeable<R,​E> createStreamDecoder​(Type type)
      • createStreamEncoder

        protected <E> Encodeable<W,​E> createStreamEncoder​(Type type)
      • getConvert

        public Convert getConvert()
      • getFeatures

        public final int getFeatures()
      • withFeatures

        protected <F extends ConvertFactory<R,​W>> F withFeatures​(int features)
      • addFeature

        protected <F extends ConvertFactory<R,​W>> F addFeature​(int feature)
      • removeFeature

        protected <F extends ConvertFactory<R,​W>> F removeFeature​(int feature)
      • withTinyFeature

        protected <F extends ConvertFactory<R,​W>> F withTinyFeature​(boolean tiny)
      • withNullableFeature

        protected <F extends ConvertFactory<R,​W>> F withNullableFeature​(boolean nullable)
      • createGenericListType

        protected Type createGenericListType​(Type componentType)
      • checkTinyFeature

        public static boolean checkTinyFeature​(int features)
      • checkNullableFeature

        public static boolean checkNullableFeature​(int features)
      • isConvertDisabled

        public boolean isConvertDisabled​(AccessibleObject element)
      • isSimpleMemberType

        public boolean isSimpleMemberType​(Class declaringClass,
                                          Type type,
                                          Class clazz)
      • registerFieldFuncConsumer

        public final void registerFieldFuncConsumer​(Consumer<BiFunction> consumer)
        设置ColumnHandler初始化的处理函数
        参数:
        consumer - ColumnHandler处理函数
      • registerSkipAllIgnore

        public final void registerSkipAllIgnore​(boolean skipIgnore)
        使所有类的所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
        参数:
        skipIgnore - 是否忽略Ignore注解
      • skipAllIgnore

        public ConvertFactory<R,​W> skipAllIgnore​(boolean skipIgnore)
        使所有类的所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
        参数:
        skipIgnore - 忽略ignore
        返回:
        自身
      • registerSkipIgnore

        public final void registerSkipIgnore​(Class type)
        使该类所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
        参数:
        type - 指定的类
      • registerIgnoreAll

        public final void registerIgnoreAll​(Class type,
                                            String... excludeColumns)
        屏蔽指定类所有字段,仅仅保留指定字段
        注意: 该配置优先级高于skipAllIgnore和ConvertColumnEntry配置
        参数:
        type - 指定的类
        excludeColumns - 需要排除的字段名
      • registerIgnoreAll

        public final void registerIgnoreAll​(Class type,
                                            Collection<String> excludeColumns)
      • register

        public final void register​(Class type,
                                   boolean ignore,
                                   String... columns)
      • register

        public final boolean register​(Class type,
                                      String column,
                                      String alias)
      • reloadCoder

        public final void reloadCoder​(Type type)
      • reloadCoder

        public final void reloadCoder​(Type type,
                                      Class clazz)
      • register

        public final <E> void register​(Class<E> clazz,
                                       Creator<? extends E> creator)
      • findCreator

        public final <T> Creator<T> findCreator​(Class<T> type)
      • loadCreator

        public final <T> Creator<T> loadCreator​(Class<T> type)
      • getAnyEncoder

        public final <E> Encodeable<W,​E> getAnyEncoder()
      • register

        public final <C extends BiFunction> void register​(Class<C> clazz,
                                                          C columnHandler)
      • register

        public final <E> void register​(Type clazz,
                                       SimpledCoder<R,​W,​E> coder)
      • register

        public final <E> void register​(Type clazz,
                                       Decodeable<R,​E> decoder)
      • register

        public final <E> void register​(Type clazz,
                                       Encodeable<W,​E> encoder)
      • findDecoder

        public final <E> Decodeable<R,​E> findDecoder​(Type type)
      • findEncoder

        public final <E> Encodeable<W,​E> findEncoder​(Type type)
      • loadDecoder

        public final <E> Decodeable<R,​E> loadDecoder​(Type type)
      • createDecoder

        public final <E> Decodeable<R,​E> createDecoder​(Type type)
      • createDecoder

        public final <E> Decodeable<R,​E> createDecoder​(Type type,
                                                             boolean skipCustomMethod)
      • loadEncoder

        public final <E> Encodeable<W,​E> loadEncoder​(Type type)
      • createEncoder

        public final <E> Encodeable<W,​E> createEncoder​(Type type)
      • createEncoder

        public final <E> Encodeable<W,​E> createEncoder​(Type type,
                                                             boolean skipCustomMethod)