summaryrefslogtreecommitdiff
path: root/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/AbstractStringBasedPredicate.java
blob: 916fc1e15639ed5d76ccb9c72ab9024b47e79c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.intellij.structuralsearch.impl.matcher.predicates;

import com.intellij.psi.PsiElement;
import com.intellij.structuralsearch.impl.matcher.MatchContext;
import com.intellij.structuralsearch.impl.matcher.handlers.MatchPredicate;

/**
 * @author Maxim.Mossienko
 */
public class AbstractStringBasedPredicate extends MatchPredicate {
  protected final String myName;
  protected final String myWithin;

  public AbstractStringBasedPredicate(String name, String within) {
    myName = name;
    myWithin = within;
  }

  public boolean match(PsiElement patternNode, PsiElement matchedNode, MatchContext context) {
    return match(patternNode, matchedNode, 0, -1, context);
  }
}