Class ClassInfo
java.lang.Object
cool.scx.reflect.ClassInfo
- All Implemented Interfaces:
AnnotatedElementInfo
ClassInfo
- Version:
- 0.0.1
- Author:
- scx567888
-
Method Summary
Modifier and TypeMethodDescription类修饰符获取所有的注解 包括继承自父级的注解 (假设存在继承的话, 如类或方法)获取类所有字段 包括继承自父类的字段获取类所有方法 包括继承自父类的方法元素上的注解类的类型数组成员类型构造参数默认构造函数 (无参构造函数) 可能为空枚举类型fields()字段findSuperType(Class<?> rawTarget) 返回指定类型的 父级 ClassInfo 支持常规类,抽象类,接口接口boolean是否 匿名类booleanisArray()是否数组booleanisFinal()是否 final 类boolean是否 内部类boolean是否基本类型booleanisStatic()是否 静态类methods()方法name()Record 规范构造参数 可能为空父类 可能为空com.fasterxml.jackson.databind.JavaTypetype()Java Type 这里我们使用 Jackson 的 JavaType 来方便进行诸如序列化等操作Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cool.scx.reflect.AnnotatedElementInfo
findAnnotation, findAnnotationFromAll, findAnnotationList, findAnnotationListFromAll
-
Method Details
-
type
public com.fasterxml.jackson.databind.JavaType type()Java Type 这里我们使用 Jackson 的 JavaType 来方便进行诸如序列化等操作 -
name
-
accessModifier
类修饰符 -
classType
类的类型 -
superClass
父类 可能为空 -
interfaces
接口 -
constructors
构造参数 -
defaultConstructor
默认构造函数 (无参构造函数) 可能为空 -
recordConstructor
Record 规范构造参数 可能为空 -
fields
字段 -
allFields
获取类所有字段 包括继承自父类的字段 -
methods
方法 -
allMethods
获取类所有方法 包括继承自父类的方法 -
annotations
Description copied from interface:AnnotatedElementInfo元素上的注解- Specified by:
annotationsin interfaceAnnotatedElementInfo
-
allAnnotations
Description copied from interface:AnnotatedElementInfo获取所有的注解 包括继承自父级的注解 (假设存在继承的话, 如类或方法)- Specified by:
allAnnotationsin interfaceAnnotatedElementInfo
-
isFinal
public boolean isFinal()是否 final 类 -
isStatic
public boolean isStatic()是否 静态类 -
isAnonymousClass
public boolean isAnonymousClass()是否 匿名类 -
isMemberClass
public boolean isMemberClass()是否 内部类 -
isPrimitive
public boolean isPrimitive()是否基本类型 -
isArray
public boolean isArray()是否数组 -
enumClass
枚举类型 -
componentType
数组成员类型 -
findSuperType
-