/**
   * Returns a processor handling XQuery queries. Suitable processor is found by matching return
   * type and handled extension.
   */
  private Processor<ModuleNode> getXQueryProcessor() {
    for (final Processor p : Lookup.getDefault().lookupAll(Processor.class)) {
      if (p.getResultType().equals(ModuleNode.class) && p.getExtension().equals("xq")) {
        return p;
      }
    }

    return null;
  }
Exemplo n.º 2
0
  /**
   * Returns the map (folder - (extension - processor) ) of all processors installed in this
   * NetBeans which process IG.
   */
  @SuppressWarnings("unchecked")
  private Map<FolderType, Map<String, Processor<Element>>> getRegisteredProcessors() {
    final Map<FolderType, Map<String, Processor<Element>>> ret =
        new HashMap<FolderType, Map<String, Processor<Element>>>();

    for (final FolderType ft : FolderType.values()) {
      ret.put(ft, new HashMap<String, Processor<Element>>());
    }

    for (final Processor p : Lookup.getDefault().lookupAll(Processor.class)) {
      if (p.getResultType().equals(Element.class)) {
        if (p.processUndefined()) {
          ret.get(p.getFolder()).put("*", p);
        }
        ret.get(p.getFolder()).put(p.getExtension(), p);
      }
    }

    return ret;
  }