@Nullable private static <T> T searchOnInterfaces(Method method, Set<Class<? extends Annotation>> annotationTypes, @Nullable String annotationName, @Nullable Class<? extends Annotation> containerType, Processor<T> processor, Set<AnnotatedElement> visited, int metaDepth, Class<?>[] ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (AnnotationUtils.isOverride(method, annotatedMethod)) { T result = searchWithFindSemantics(annotatedMethod, annotationTypes, annotationName, containerType, processor, visited, metaDepth); if (result != null) { return result; } } } } } return null; }
@Nullable private static <A extends Annotation> A searchOnInterfaces(Method method, Class<A> annotationType, Class<?>... ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (isOverride(method, annotatedMethod)) { A annotation = getAnnotation(annotatedMethod, annotationType); if (annotation != null) { return annotation; } } } } } return null; }
@Test public void interfaceWithAnnotatedMethods() { assertTrue(AnnotationUtils.getAnnotatedMethodsInBaseType(NonAnnotatedInterface.class).isEmpty()); assertFalse(AnnotationUtils.getAnnotatedMethodsInBaseType(AnnotatedInterface.class).isEmpty()); assertTrue(AnnotationUtils.getAnnotatedMethodsInBaseType(NullableAnnotatedInterface.class).isEmpty()); }
@Nullable private static <T> T searchOnInterfaces(Method method, Set<Class<? extends Annotation>> annotationTypes, @Nullable String annotationName, @Nullable Class<? extends Annotation> containerType, Processor<T> processor, Set<AnnotatedElement> visited, int metaDepth, Class<?>[] ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (AnnotationUtils.isOverride(method, annotatedMethod)) { T result = searchWithFindSemantics(annotatedMethod, annotationTypes, annotationName, containerType, processor, visited, metaDepth); if (result != null) { return result; } } } } } return null; }
@Nullable private static <A extends Annotation> A searchOnInterfaces(Method method, Class<A> annotationType, Class<?>... ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (isOverride(method, annotatedMethod)) { A annotation = getAnnotation(annotatedMethod, annotationType); if (annotation != null) { return annotation; } } } } } return null; }
break; Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {
break; Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {
break; Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {
break; Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {
@Nullable private static <T> T searchOnInterfaces(Method method, Set<Class<? extends Annotation>> annotationTypes, @Nullable String annotationName, @Nullable Class<? extends Annotation> containerType, Processor<T> processor, Set<AnnotatedElement> visited, int metaDepth, Class<?>[] ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (AnnotationUtils.isOverride(method, annotatedMethod)) { T result = searchWithFindSemantics(annotatedMethod, annotationTypes, annotationName, containerType, processor, visited, metaDepth); if (result != null) { return result; } } } } } return null; }
@Nullable private static <A extends Annotation> A searchOnInterfaces(Method method, Class<A> annotationType, Class<?>... ifcs) { for (Class<?> ifc : ifcs) { Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(ifc); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) { if (isOverride(method, annotatedMethod)) { A annotation = getAnnotation(annotatedMethod, annotationType); if (annotation != null) { return annotation; } } } } } return null; }
break; Set<Method> annotatedMethods = getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {
break; Set<Method> annotatedMethods = AnnotationUtils.getAnnotatedMethodsInBaseType(clazz); if (!annotatedMethods.isEmpty()) { for (Method annotatedMethod : annotatedMethods) {