PsiMethod (final PsiClass aClass) { PsiElementFactory factory = JavaPsiFacade.getInstance(aClass.getProject()).getElementFactory(); PsiMethod method; try { method = factory.createMethodFromText("void " + AsmCodeGenerator.CREATE_COMPONENTS_METHOD_NAME + "() {}", aClass); } catch (IncorrectOperationException e) { throw new RuntimeException(e); } return aClass.findMethodBySignature(method, true); }