private static PsiReference[] createReferences(GenericDomValue<?> domValue,
                                                 XmlElement psiElement,
                                                 Object converter,
                                                 DomInvocationHandler handler,
                                                 DomManager domManager) {
    final XmlFile file = handler.getFile();
    final DomFileDescription<?> description = domManager.getDomFileDescription(file);
    if (description == null) {
      // should not happen
      return PsiReference.EMPTY_ARRAY;
    }

    List<PsiReference> result = new ArrayList<>();

    ConvertContext context = ConvertContextFactory.createConvertContext(domValue);
    final List<DomReferenceInjector> injectors = description.getReferenceInjectors();
    if (!injectors.isEmpty()) {
      String unresolvedText = ElementManipulators.getValueText(psiElement);
      for (DomReferenceInjector each : injectors) {
        Collections.addAll(result, each.inject(unresolvedText, psiElement, context));
      }
    }

    Collections.addAll(result, doCreateReferences(domValue, psiElement, converter, context));
    return result.toArray(PsiReference.EMPTY_ARRAY);
  }
private static PsiReference[] createReferences(GenericDomValue<?> domValue,
                                                 XmlElement psiElement,
                                                 Object converter,
                                                 DomInvocationHandler handler,
                                                 DomManager domManager)