mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-08 22:26:17 +00:00
fix[proxy]: the annotations of the bean of the parent class cannot be scanned
This commit is contained in:
@@ -164,9 +164,9 @@ public abstract class ReflectionUtils {
|
||||
* @param annotation 指定注解的Class
|
||||
* @return 数组,可能长度为0
|
||||
*/
|
||||
public static Method[] getMethodsByAnnoInPOJOClass(Class<?> clazz, Class<? extends Annotation> annotation) {
|
||||
public static Method[] getMethodsByAnnotation(Class<?> clazz, Class<? extends Annotation> annotation) {
|
||||
var list = new ArrayList<Method>();
|
||||
var methods = clazz.getDeclaredMethods();
|
||||
var methods = getAllMethods(clazz);
|
||||
for (var method : methods) {
|
||||
if (method.isAnnotationPresent(annotation)) {
|
||||
list.add(method);
|
||||
@@ -175,16 +175,6 @@ public abstract class ReflectionUtils {
|
||||
return ArrayUtils.listToArray(list, Method.class);
|
||||
}
|
||||
|
||||
public static Method[] getMethodsByNameInPOJOClass(Class<?> clazz, String methodName) {
|
||||
var list = new ArrayList<Method>();
|
||||
var methods = clazz.getDeclaredMethods();
|
||||
for (var method : methods) {
|
||||
if (method.getName().equalsIgnoreCase(methodName)) {
|
||||
list.add(method);
|
||||
}
|
||||
}
|
||||
return ArrayUtils.listToArray(list, Method.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to get all Methods on the supplied class.
|
||||
|
||||
Reference in New Issue
Block a user