java.lang.Object
org.miaixz.bus.mapper.parsing.SchemaTypeParser
- All Implemented Interfaces:
Comparable<org.miaixz.bus.core.Order>,org.miaixz.bus.core.Order,ClassMetaResolver,ORDER
- Direct Known Subclasses:
SchemaClassParser
抽象实体类查找器,根据泛型从返回值、参数、接口泛型参数判断对应的实体类类型
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.miaixz.bus.mapper.builder.ClassMetaResolver
ClassMetaResolver.ClassFinderInstance, ClassMetaResolver.MapperTypeMethod -
Field Summary
Fields inherited from interface org.miaixz.bus.mapper.builder.ClassMetaResolver
ENTITY_CLASS_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.miaixz.bus.core.lang.Optional<Class<?>> 查找当前方法对应的实体类,依次检查方法返回值、参数和接口泛型protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodAndMapperType(Class<?> mapperType, Method mapperMethod) 根据方法所在接口的泛型获取实体类,仅适用于定义在泛型接口中的方法protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodParamTypes(Class<?> mapperType, Method mapperMethod) 根据方法参数类型获取实体类protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodReturnType(Class<?> mapperType, Method mapperMethod) 根据方法返回值类型获取实体类protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperType(Class<?> mapperType) 根据接口泛型获取实体类,优先级最低,与当前执行方法无关protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByType(Type type) 根据单个类型获取可能的实体类类型protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByTypes(Type[] types) 遍历类型数组获取可能的实体类类型Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.mapper.builder.ClassMetaResolver
isClassMethods inherited from interface org.miaixz.bus.core.Order
compareTo, order
-
Constructor Details
-
SchemaTypeParser
public SchemaTypeParser()
-
-
Method Details
-
findClass
public org.miaixz.bus.core.lang.Optional<Class<?>> findClass(Class<?> mapperType, Method mapperMethod) 查找当前方法对应的实体类,依次检查方法返回值、参数和接口泛型- Specified by:
findClassin interfaceClassMetaResolver- Parameters:
mapperType- Mapper 接口,不能为空mapperMethod- Mapper 接口方法,可以为空- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByMapperMethodReturnType
protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodReturnType(Class<?> mapperType, Method mapperMethod) 根据方法返回值类型获取实体类- Parameters:
mapperType- Mapper 接口mapperMethod- 方法- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByMapperMethodParamTypes
protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodParamTypes(Class<?> mapperType, Method mapperMethod) 根据方法参数类型获取实体类- Parameters:
mapperType- Mapper 接口mapperMethod- 方法- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByMapperMethodAndMapperType
protected org.miaixz.bus.core.lang.Optional<Class<?>> getClassByMapperMethodAndMapperType(Class<?> mapperType, Method mapperMethod) 根据方法所在接口的泛型获取实体类,仅适用于定义在泛型接口中的方法- Parameters:
mapperType- Mapper 接口mapperMethod- 方法- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByMapperType
根据接口泛型获取实体类,优先级最低,与当前执行方法无关- Parameters:
mapperType- Mapper 接口- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByType
根据单个类型获取可能的实体类类型- Parameters:
type- 类型- Returns:
- 实体类类型的 Optional 包装对象
-
getClassByTypes
遍历类型数组获取可能的实体类类型- Parameters:
types- 类型数组- Returns:
- 实体类类型的 Optional 包装对象
-