diff options
Diffstat (limited to 'platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java')
-rw-r--r-- | platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java b/platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java new file mode 100644 index 000000000000..594686e14d49 --- /dev/null +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java @@ -0,0 +1,84 @@ +package com.intellij.structuralsearch; + +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.project.Project; +import com.intellij.psi.PsiElement; +import com.intellij.structuralsearch.impl.matcher.MatcherImpl; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +/** + * This class makes program structure tree matching: + */ +public class Matcher extends MatcherImpl { + + public Matcher(Project project) { + super(project); + } + + public Matcher(final Project project, final MatchOptions matchOptions) { + super(project, matchOptions); + } + + /** + * Finds the matches of given pattern starting from given tree element. + * @throws MalformedPatternException + * @throws UnsupportedPatternException + */ + public void findMatches(MatchResultSink sink,MatchOptions options) throws + MalformedPatternException, UnsupportedPatternException + { + super.findMatches(sink,options); + } + + /** + * Finds the matches of given pattern starting from given tree element. + * @param source string for search + * @param pattern to be searched + * @return list of matches found + * @throws MalformedPatternException + * @throws UnsupportedPatternException + */ + public List<MatchResult> testFindMatches(String source, + String pattern, + MatchOptions options, + boolean filePattern, + FileType sourceFileType, + String sourceExtension, + boolean physicalSourceFile) + throws MalformedPatternException, UnsupportedPatternException { + return super.testFindMatches(source, pattern, options, filePattern, sourceFileType, sourceExtension, physicalSourceFile); + } + + public List<MatchResult> testFindMatches(String source, String pattern, MatchOptions options, boolean filePattern) + throws MalformedPatternException, UnsupportedPatternException { + return super.testFindMatches(source, pattern, options, filePattern); + } + + /** + * Finds the matches of given pattern starting from given tree element. + * @param sink + * @param options + * @throws MalformedPatternException + * @throws UnsupportedPatternException + */ + public void testFindMatches(MatchResultSink sink,MatchOptions options) + throws MalformedPatternException, UnsupportedPatternException { + + super.testFindMatches(sink,options); + } + + /** + * Tests if given element is matched by given pattern starting from target variable. If matching succeeds + * then not null match result is returned. + * @throws MalformedPatternException + * @throws UnsupportedPatternException + */ + @Nullable + public MatchResult isMatchedByDownUp(PsiElement element,MatchOptions options) throws + MalformedPatternException, UnsupportedPatternException + { + return super.isMatchedByDownUp(element, options); + } +} |