Module bus.mapper

Interface ClassMetaResolver

All Superinterfaces:
Comparable<org.miaixz.bus.core.Order>, org.miaixz.bus.core.Order, ORDER
All Known Implementing Classes:
SchemaClassParser, SchemaTypeParser

public interface ClassMetaResolver extends ORDER
根据类型和方法等信息获取实体类类型,可通过 SPI 方式替换默认实现
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    实体类查找器实例管理类
    static class 
    Mapper 接口和方法,用作缓存 Key
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Map<ClassMetaResolver.MapperTypeMethod,org.miaixz.bus.core.lang.Optional<Class<?>>>
    缓存,避免方法执行时每次都查找,键为 MapperTypeMethod,值为对应的实体类

    Fields inherited from interface org.miaixz.bus.mapper.ORDER

    ASC, DESC
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.miaixz.bus.core.lang.Optional<Class<?>>
    find(Class<?> mapperType, Method mapperMethod)
    查找当前方法对应的实体类
    org.miaixz.bus.core.lang.Optional<Class<?>>
    findClass(Class<?> mapperType, Method mapperMethod)
    查找当前方法对应的实体类
    boolean
    isClass(Class<?> clazz)
    判断指定的类型是否为定义的实体类类型

    Methods inherited from interface org.miaixz.bus.core.Order

    compareTo, order
  • Field Details

    • ENTITY_CLASS_MAP

      static final Map<ClassMetaResolver.MapperTypeMethod,org.miaixz.bus.core.lang.Optional<Class<?>>> ENTITY_CLASS_MAP
      缓存,避免方法执行时每次都查找,键为 MapperTypeMethod,值为对应的实体类
  • Method Details

    • find

      static org.miaixz.bus.core.lang.Optional<Class<?>> find(Class<?> mapperType, Method mapperMethod)
      查找当前方法对应的实体类
      Parameters:
      mapperType - Mapper 接口,不能为空
      mapperMethod - Mapper 接口方法,可以为空
      Returns:
      实体类类型的 Optional 包装对象
    • findClass

      org.miaixz.bus.core.lang.Optional<Class<?>> findClass(Class<?> mapperType, Method mapperMethod)
      查找当前方法对应的实体类
      Parameters:
      mapperType - Mapper 接口,不能为空
      mapperMethod - Mapper 接口方法,可以为空
      Returns:
      实体类类型的 Optional 包装对象
    • isClass

      boolean isClass(Class<?> clazz)
      判断指定的类型是否为定义的实体类类型
      Parameters:
      clazz - 类型
      Returns:
      true 表示是实体类类型,false 表示不是