@Override
  public void validate(@NotNull XmlTag context, @NotNull ValidationHost host) {
    final XmlTag referencedTag = getReferencedTag(context);
    if (referencedTag != null) {
      final XmlElementDescriptor descriptor = referencedTag.getDescriptor();
      if (descriptor != null) {
        final PsiElement declaration = descriptor.getDeclaration();
        if (declaration instanceof PsiClass psiClass) {
          JavaFxPsiUtil.isClassAcceptable(context.getParentTag(), psiClass, (@InspectionMessage String errorMessage, ValidationHost.ErrorType errorType) ->
            host.addMessage(context.getNavigationElement(), errorMessage, errorType));
          final String contextName = context.getName();
          if (FxmlConstants.FX_COPY.equals(contextName)) {
            boolean copyConstructorFound = false;
            for (PsiMethod constructor : psiClass.getConstructors()) {
              final PsiParameter[] parameters = constructor.getParameterList().getParameters();
              if (parameters.length == 1 && psiClass == PsiUtil.resolveClassInType(parameters[0].getType())) {
                copyConstructorFound = true;
                break;
              }
            }
            if (!copyConstructorFound) {
              host.addMessage(context.getNavigationElement(),
                              JavaFXBundle.message("inspection.message.copy.constructor.not.found", psiClass.getName()),
                              ValidationHost.ErrorType.ERROR);
            }
          }
        }
      }
    }
  }
@Override
  public void validate(@NotNull XmlTag context, @NotNull ValidationHost host)