TreeElement (final Project project, final String text, final PsiElement context) { final PsiJavaParserFacade parserFacade = JavaPsiFacade.getInstance(project).getParserFacade(); final PsiExpression expression = parserFacade.createExpressionFromText(text, context); return (TreeElement)expression.getNode(); }