Package org.eclipse.jdt.core.search

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


      SearchPattern pattern = SearchPattern.createPattern(fromMethod, IJavaSearchConstants.ALL_OCCURRENCES | IJavaSearchConstants.IGNORE_RETURN_TYPE);
      SearchParticipant[] participants = new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() };
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();

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

      SearchMatch[] matches = requestor.getMatches();
      for (SearchMatch match : matches) {
        try {
          if (!(match instanceof MethodReferenceMatch)) {
View Full Code Here


      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

        }
      }
    };

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

  private void findVariablesForFormal(SingleVariableDeclaration svd)
      throws CoreException {
View Full Code Here

        (IType) method.getParent());
    SearchPattern pattern = SearchPattern.createPattern(method,
        IJavaSearchConstants.REFERENCES, GENERICS_AGNOSTIC_MATCH_RULE);
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
    SearchEngine searchEngine = new SearchEngine();
    searchEngine
        .search(pattern, new SearchParticipant[] { SearchEngine
            .getDefaultSearchParticipant() }, scope, requestor,
            null /* progress monitor */);

    return requestor.isCalledFromOutside();
View Full Code Here

        Object element = match.getElement();
        System.out.println(element.getClass().getName());
        System.out.println(element);
      }
    };
    engine.search(pattern, participants, scope, requestor, new NullProgressMonitor());
  }
 
  @After
  public void after() throws Exception{
    project.dispose();
View Full Code Here

  private void search(SearchPattern pattern) {
    try {
      SearchEngine engine = new SearchEngine();
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
      SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
      engine.search(pattern, participants, scope, requestor, monitor);
    } catch (CoreException e) {
      JavaDocActivator.getDefault().handleSystemError(e, this);
    }
  }
View Full Code Here

    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Relation", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    engine.search(pattern, participants, scope, this, monitor);
  }
 
  public void addRelation(Relation rel) {
    rels.put(rel.getName(), rel);
  }
View Full Code Here

    SearchPattern pattern = SearchPattern.createPattern("Constraint", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    ConstraintRequestor consReq = new ConstraintRequestor(rels);   
    engine.search(pattern, participants, scope, consReq, monitor);
    constraints.addAll(consReq.getConstraints());
   
    CallbackRequestor callRequest = new CallbackRequestor(rels);
    pattern = SearchPattern.createPattern("Callback", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    engine.search(pattern, participants, scope, callRequest, monitor);
View Full Code Here

    engine.search(pattern, participants, scope, consReq, monitor);
    constraints.addAll(consReq.getConstraints());
   
    CallbackRequestor callRequest = new CallbackRequestor(rels);
    pattern = SearchPattern.createPattern("Callback", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    engine.search(pattern, participants, scope, callRequest, monitor);
    constraints.addAll(callRequest.getConstraints());
   
    EffectRequestor effReq = new EffectRequestor(rels);
    for (Relation rel : rels) {
      pattern = SearchPattern.createPattern(rel.getName(), IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
View Full Code Here

    constraints.addAll(callRequest.getConstraints());
   
    EffectRequestor effReq = new EffectRequestor(rels);
    for (Relation rel : rels) {
      pattern = SearchPattern.createPattern(rel.getName(), IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
      engine.search(pattern, participants, scope, effReq, monitor);     
    }
    constraints.addAll(effReq.getConstraints());
   
  }
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.