findFieldOrNull
fun findFieldOrNull(clz: Class<*>, findSuper: Boolean? = null, query: FieldQuery.() -> Unit): Field?
按查询条件查找字段,找不到返回 null。
Parameters
clz
目标类
findSuper
null=智能搜索(默认), false=仅当前类, true=强制搜索继承链
query
查询条件块
fun findFieldOrNull(className: String, classLoader: ClassLoader = EzReflect.classLoader, findSuper: Boolean? = null, query: FieldQuery.() -> Unit): Field?
按类名查找字段,找不到返回 null。
Parameters
className
目标类名
classLoader
用于加载目标类的 ClassLoader
findSuper
null=智能搜索(默认), false=仅当前类, true=强制搜索继承链
query
查询条件块
fun String.findFieldOrNull(classLoader: ClassLoader = EzReflect.classLoader, findSuper: Boolean? = null, query: FieldQuery.() -> Unit): Field?
从类名查找字段,找不到返回 null。
Parameters
classLoader
用于加载当前类名的 ClassLoader
findSuper
null=智能搜索(默认), false=仅当前类, true=强制搜索继承链
query
查询条件块
从 Class 对象查找字段,找不到返回 null。
Parameters
findSuper
null=智能搜索(默认), false=仅当前类, true=强制搜索继承链
query
查询条件块