public @Nullable ElementPattern<PsiElement> createElementPattern() {
    if (patterns == null || patterns.length == 0) {
      Logger.getInstance(PsiReferenceProviderBean.class)
        .error(new PluginException("At least one pattern should be specified", pluginDescriptor.getPluginId()));
      return null;
    }
    if (patterns.length > 1) {
      List<ElementPattern<PsiElement>> result = new ArrayList<>(patterns.length);
      for (ElementPatternBean t : patterns) {
        ElementPattern<PsiElement> o = t.compilePattern();
        if (o != null) {
          result.add(o);
        }
      }
      result = result.isEmpty() ? Collections.emptyList() : result;
      //noinspection unchecked
      return StandardPatterns.or(result.toArray(new ElementPattern[0]));
    }
    else {
      return patterns[0].compilePattern();
    }
  }
public @Nullable ElementPattern<PsiElement> createElementPattern()