private static void appendLinkOrText(
    StringBuilder buffer,
    PsiAnnotationMemberValue memberValue,
    boolean generateLink,
    boolean isForRenderedDoc,
    boolean doSyntaxHighlighting
  ) {
    if (memberValue instanceof PsiQualifiedReferenceElement) {
      String text = ((PsiQualifiedReferenceElement)memberValue).getCanonicalText();
      PsiElement resolve = null;
      try {
        resolve = ((PsiQualifiedReferenceElement)memberValue).resolve();
      }
      catch (Exception e) {
        LOG.debug(e);
      }

      if (resolve instanceof PsiField field) {
        PsiClass aClass = field.getContainingClass();

        if (generateLink) {
          int startOfPropertyNamePosition = text.lastIndexOf('.');
          if (startOfPropertyNamePosition != -1) {
            text = text.substring(0, startOfPropertyNamePosition) + '#' + text.substring(startOfPropertyNamePosition + 1);
          }
          else {
            if (aClass != null) text = aClass.getQualifiedName() + '#' + field.getName();
          }
          JavaDocInfoGeneratorFactory.getBuilder(field.getProject())
            .setIsGenerationForRenderedDoc(isForRenderedDoc)
            .setDoHighlightSignatures(doSyntaxHighlighting)
            .create()
            .generateLink(buffer, text, aClass != null ? aClass.getName() + '.' + field.getName() : null, memberValue, false);
        }
        else {
          appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet(
            doSyntaxHighlighting,
            isForRenderedDoc,
            buffer,
            memberValue.getProject(),
            memberValue.getLanguage(),
            aClass != null ? aClass.getName() + '.' + field.getName() : memberValue.getText());
        }
        return;
      }
    }

    appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet(
      doSyntaxHighlighting,
      isForRenderedDoc,
      buffer,
      memberValue.getProject(),
      memberValue.getLanguage(),
      memberValue.getText());
  }
private static void appendLinkOrText(
    StringBuilder buffer,
    PsiAnnotationMemberValue memberValue,
    boolean generateLink,
    boolean isForRenderedDoc,
    boolean doSyntaxHighlighting
  )