void (PsiElement element) { final PsiElement parent = element.getParent(); final PsiReferenceExpression reference = (PsiReferenceExpression)parent; final PsiModifierListOwner member = (PsiModifierListOwner)reference.resolve(); if (member == null) { return; } final PsiModifierList modifiers = member.getModifierList(); if (modifiers == null) { return; } modifiers.setModifierProperty(PsiModifier.PUBLIC, false); modifiers.setModifierProperty(PsiModifier.PROTECTED, false); modifiers.setModifierProperty(PsiModifier.PRIVATE, false); }