Java 类com.intellij.psi.filters.element.ExcludeSillyAssignment 实例源码

项目:intellij-ce-playground    文件:RecursionWeigher.java   
@Nullable
static ElementFilter recursionFilter(PsiElement element) {
  if (PsiJavaPatterns.psiElement().afterLeaf(PsiKeyword.RETURN).inside(PsiReturnStatement.class).accepts(element)) {
    return new ExcludeDeclaredFilter(ElementClassFilter.METHOD);
  }

  if (PsiJavaPatterns.psiElement().inside(
    StandardPatterns.or(
      PsiJavaPatterns.psiElement(PsiAssignmentExpression.class),
      PsiJavaPatterns.psiElement(PsiVariable.class))).
      andNot(PsiJavaPatterns.psiElement().afterLeaf(".")).accepts(element)) {
    return new AndFilter(new ExcludeSillyAssignment(),
                                                 new ExcludeDeclaredFilter(new ClassFilter(PsiVariable.class)));
  }
  return null;
}
项目:tools-idea    文件:RecursionWeigher.java   
@Nullable
static ElementFilter recursionFilter(PsiElement element) {
  if (PsiJavaPatterns.psiElement().afterLeaf(PsiKeyword.RETURN).inside(PsiReturnStatement.class).accepts(element)) {
    return new ExcludeDeclaredFilter(ElementClassFilter.METHOD);
  }

  if (PsiJavaPatterns.psiElement().inside(
    StandardPatterns.or(
      PsiJavaPatterns.psiElement(PsiAssignmentExpression.class),
      PsiJavaPatterns.psiElement(PsiVariable.class))).
      andNot(PsiJavaPatterns.psiElement().afterLeaf(".")).accepts(element)) {
    return new AndFilter(new ExcludeSillyAssignment(),
                                                 new ExcludeDeclaredFilter(new ClassFilter(PsiVariable.class)));
  }
  return null;
}
项目:consulo-java    文件:RecursionWeigher.java   
@Nullable
static ElementFilter recursionFilter(PsiElement element)
{
    if(PsiJavaPatterns.psiElement().afterLeaf(PsiKeyword.RETURN).inside(PsiReturnStatement.class).accepts(element))
    {
        return new ExcludeDeclaredFilter(ElementClassFilter.METHOD);
    }

    if(PsiJavaPatterns.psiElement().inside(StandardPatterns.or(PsiJavaPatterns.psiElement(PsiAssignmentExpression.class), PsiJavaPatterns.psiElement(PsiVariable.class))).
            andNot(PsiJavaPatterns.psiElement().afterLeaf(".")).accepts(element))
    {
        return new AndFilter(new ExcludeSillyAssignment(), new ExcludeDeclaredFilter(new ClassFilter(PsiVariable.class)));
    }
    return null;
}