Search in sources :

Example 1 with DelegatingHandler

use of com.intellij.structuralsearch.impl.matcher.handlers.DelegatingHandler in project intellij-community by JetBrains.

the class GlobalMatchingVisitor method handleTypedElement.

public final boolean handleTypedElement(final PsiElement typedElement, final PsiElement match) {
    MatchingHandler handler = matchContext.getPattern().getHandler(typedElement);
    final MatchingHandler initialHandler = handler;
    if (handler instanceof DelegatingHandler) {
        handler = ((DelegatingHandler) handler).getDelegate();
    }
    assert handler instanceof SubstitutionHandler : handler != null ? handler.getClass() : "null" + ' ' + (initialHandler != null ? initialHandler.getClass() : "null");
    return ((SubstitutionHandler) handler).handle(match, matchContext);
}
Also used : DelegatingHandler(com.intellij.structuralsearch.impl.matcher.handlers.DelegatingHandler) SubstitutionHandler(com.intellij.structuralsearch.impl.matcher.handlers.SubstitutionHandler) MatchingHandler(com.intellij.structuralsearch.impl.matcher.handlers.MatchingHandler)

Aggregations

DelegatingHandler (com.intellij.structuralsearch.impl.matcher.handlers.DelegatingHandler)1 MatchingHandler (com.intellij.structuralsearch.impl.matcher.handlers.MatchingHandler)1 SubstitutionHandler (com.intellij.structuralsearch.impl.matcher.handlers.SubstitutionHandler)1