Example #1
0
  private static boolean containsAnnotation(
      DeclarationDescriptor descriptor, FqName annotationClassFqName) {
    DeclarationDescriptor original = descriptor.getOriginal();
    Annotations annotations = original.getAnnotations();

    if (annotations.findAnnotation(annotationClassFqName) != null) return true;

    AnnotationUseSiteTarget associatedUseSiteTarget =
        AnnotationUseSiteTarget.Companion.getAssociatedUseSiteTarget(descriptor);
    if (associatedUseSiteTarget != null) {
      if (Annotations.Companion.findUseSiteTargetedAnnotation(
              annotations, associatedUseSiteTarget, annotationClassFqName)
          != null) {
        return true;
      }
    }

    return false;
  }
Example #2
0
 public boolean isMemberOfAny(@NotNull DeclarationDescriptor descriptor) {
   return descriptor.getContainingDeclaration() == getAny();
 }
Example #3
0
 static boolean containsAnnotation(
     DeclarationDescriptor descriptor, FqName annotationClassFqName) {
   return descriptor.getOriginal().getAnnotations().findAnnotation(annotationClassFqName) != null;
 }