private void setParamField(Class<?> cls) { if (Object.class == cls || cls == null) { return; } for (Field f : cls.getDeclaredFields()) { for (Annotation a : f.getAnnotations()) { if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) { if (paramFields == null) { paramFields = new ArrayList<Field>(); } paramsAvailable = true; paramFields.add(f); } } } setParamField(cls.getSuperclass()); }
private void setParamField(Class<?> cls) { if (Object.class == cls || cls == null) { return; } for (Field f : ReflectionUtil.getDeclaredFields(cls)) { for (Annotation a : f.getAnnotations()) { if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) { if (paramFields == null) { paramFields = new ArrayList<>(); } paramsAvailable = true; paramFields.add(f); } } } setParamField(cls.getSuperclass()); }
private void setParamMethods(Class<?> cls) { for (Method m : cls.getMethods()) { if (!m.getName().startsWith("set") || m.getParameterTypes().length != 1) { continue; } for (Annotation a : m.getAnnotations()) { if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) { addParamMethod(m); break; } } } Class<?>[] interfaces = cls.getInterfaces(); for (Class<?> i : interfaces) { setParamMethods(i); } }
private void setParamMethods(Class<?> cls) { for (Method m : cls.getMethods()) { if (!m.getName().startsWith("set") || m.getParameterTypes().length != 1) { continue; } for (Annotation a : m.getAnnotations()) { if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) { addParamMethod(m); break; } } } Class<?>[] interfaces = cls.getInterfaces(); for (Class<?> i : interfaces) { setParamMethods(i); } }