Search in sources :

Example 1 with JavaMethod

use of com.intellij.util.xml.JavaMethod 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);
}
Also used : Type(java.lang.reflect.Type) AnnotatedElement(java.lang.reflect.AnnotatedElement) JavaMethod(com.intellij.util.xml.JavaMethod) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

JavaMethod (com.intellij.util.xml.JavaMethod)1 AnnotatedElement (java.lang.reflect.AnnotatedElement)1 Type (java.lang.reflect.Type)1 Nullable (org.jetbrains.annotations.Nullable)1