本文整理匯總了Java中com.intellij.psi.filters.element.ExcludeSillyAssignment類的典型用法代碼示例。如果您正苦於以下問題:Java ExcludeSillyAssignment類的具體用法?Java ExcludeSillyAssignment怎麽用?Java ExcludeSillyAssignment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExcludeSillyAssignment類屬於com.intellij.psi.filters.element包,在下文中一共展示了ExcludeSillyAssignment類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: recursionFilter
import com.intellij.psi.filters.element.ExcludeSillyAssignment; //導入依賴的package包/類
@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;
}
示例2: recursionFilter
import com.intellij.psi.filters.element.ExcludeSillyAssignment; //導入依賴的package包/類
@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;
}