use of java.lang.reflect.AnnotatedElement in project spring-framework by spring-projects.
the class MultipleComposedAnnotationsOnSingleAnnotatedElementTests method findMultipleComposedAnnotationsOnMethod.
@Test
public void findMultipleComposedAnnotationsOnMethod() throws Exception {
AnnotatedElement element = getClass().getDeclaredMethod("multipleComposedCachesMethod");
assertFindAllMergedAnnotationsBehavior(element);
}
use of java.lang.reflect.AnnotatedElement in project spring-framework by spring-projects.
the class MultipleComposedAnnotationsOnSingleAnnotatedElementTests method findComposedPlusLocalAnnotationsOnMethod.
@Test
public void findComposedPlusLocalAnnotationsOnMethod() throws Exception {
AnnotatedElement element = getClass().getDeclaredMethod("composedPlusLocalCachesMethod");
assertFindAllMergedAnnotationsBehavior(element);
}
use of java.lang.reflect.AnnotatedElement in project intellij-community by JetBrains.
the class CollectionChildDescriptionImpl method getAnnotation.
@Override
@Nullable
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
final JavaMethod method = getGetterMethod();
if (method != null) {
final T annotation = method.getAnnotation(annotationClass);
if (annotation != null)
return annotation;
}
final Type elemType = getType();
return elemType instanceof AnnotatedElement ? ((AnnotatedElement) elemType).getAnnotation(annotationClass) : super.getAnnotation(annotationClass);
}
use of java.lang.reflect.AnnotatedElement in project intellij-community by JetBrains.
the class FixedChildDescriptionImpl method getAnnotation.
@Override
@Nullable
public <T extends Annotation> T getAnnotation(int index, Class<? extends T> annotationClass) {
final JavaMethod method = getGetterMethod(index);
if (method != null) {
final T annotation = method.getAnnotation(annotationClass);
if (annotation != null)
return annotation;
}
final Type elemType = getType();
if (elemType instanceof AnnotatedElement) {
T annotation = ((AnnotatedElement) elemType).getAnnotation(annotationClass);
if (annotation != null)
return annotation;
}
return super.getAnnotation(annotationClass);
}
Aggregations