Examples of SearchEngine


Examples of org.eclipse.jdt.core.search.SearchEngine

    List<String> results = new ArrayList<String>();
   
    try {
      IType singleton = javaProject.findType("javax.ejb.Singleton");
     
      SearchEngine searchEngine = new SearchEngine();
      SearchPattern pattern = SearchPattern.createPattern(singleton, IJavaSearchConstants.REFERENCES);
      SearchParticipant[] participants = new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() };
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();

      SingletonBeanSearchRequestor requestor = new SingletonBeanSearchRequestor();
      searchEngine.search(pattern, participants, scope, requestor, null);

      SearchMatch[] matches = requestor.getMatches();

      for (SearchMatch searchMatch : matches) {
        IType type = (IType) searchMatch.getElement();
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchEngine

        final Collection col = (Collection) fit.next();
        for (final Iterator cit = col.iterator(); cit.hasNext();) {
          final IJavaElement elem = (IJavaElement) cit.next();

          // The search engine.
          final SearchEngine engine = new SearchEngine();

          // The search pattern corresponding to the entities whose
          // type must be altered.
          SearchPattern pattern = SearchPattern.createPattern(elem,
              IJavaSearchConstants.DECLARATIONS,
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchEngine

          }
        }
      }
    };

    final SearchEngine searchEngine = new SearchEngine();
    searchEngine.search(pattern, new SearchParticipant[] { SearchEngine
        .getDefaultSearchParticipant() }, this.scope, requestor, null);
  }
View Full Code Here

Examples of org.opensolaris.opengrok.search.SearchEngine

  @SuppressWarnings({ "unchecked", "deprecation" })
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    JSONObject result = new JSONObject();
    SearchEngine engine = new SearchEngine();

    boolean valid = false;
   
    String freetext = req.getParameter(PARAM_FREETEXT);
    String def = req.getParameter(PARAM_DEF);
    String symbol = req.getParameter(PARAM_SYMBOL);
    String path = req.getParameter(PARAM_PATH);
    String hist = req.getParameter(PARAM_HIST);

    if (freetext != null) {
      freetext = URLDecoder.decode(freetext);
      engine.setFreetext(freetext);
      valid = true;
      result.put(PARAM_FREETEXT, freetext);
    }

    if (def != null) {
      def = URLDecoder.decode(def);
      engine.setDefinition(def);
      valid = true;
      result.put(PARAM_DEF, def);
    }

    if (symbol != null) {
      symbol = URLDecoder.decode(symbol);
      engine.setSymbol(symbol);
      valid = true;
      result.put(PARAM_SYMBOL, symbol);
    }

    if (path != null) {
      path = URLDecoder.decode(path);
      engine.setFile(path);
      valid = true;
      result.put(PARAM_PATH, path);
    }

    if (hist != null) {
      hist = URLDecoder.decode(hist);
      engine.setHistory(hist);
      valid = true;
      result.put(PARAM_HIST, hist);
    }

    if (valid) {
      long start = System.currentTimeMillis();
     
      int numResults = engine.search();
      int maxResults = MAX_RESULTS;
      String maxResultsParam = req.getParameter(PARAM_MAXRESULTS);
      if (maxResultsParam != null) {
        try {
          maxResults = Integer.parseInt(maxResultsParam);
          result.put(PARAM_MAXRESULTS, maxResults);
        } catch (NumberFormatException ex) {
        }
      }
      List<Hit> results = new ArrayList<Hit>(maxResults);
      engine.results(0,
          numResults > maxResults ? maxResults : numResults, results);
      JSONArray resultsArray = new JSONArray();
      for (Hit hit : results) {
        JSONObject hitJson = new JSONObject();
        hitJson.put(ATTRIBUTE_DIRECTORY,
View Full Code Here

Examples of railo.runtime.search.SearchEngine

   * @throws PageException
  **/
  public void setCollection(String collection) throws PageException  {
    String[] collNames=ListUtil.toStringArrayTrim(ListUtil.listToArrayRemoveEmpty(collection,','));
      collections=new SearchCollection[collNames.length];
      SearchEngine se = pageContext.getConfig().getSearchEngine();
      try {
        for(int i=0;i<collections.length;i++) {
            collections[i]=se.getCollectionByName(collNames[i]);
        }
      } catch (SearchException e) {
          collections=null;
          throw Caster.toPageException(e);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.