PsiType (PsiElement element) { if (element instanceof PsiVariable) { return ((PsiVariable)element).getType(); } else if (element instanceof PsiExpression) { return ((PsiExpression)element).getType(); } else if (element instanceof PsiMethod) { return ((PsiMethod)element).getReturnType(); } return null; }